tmpfiles: refactor into separate executable

The tmpfiles.d spec has proven useful in systemd, enough so that some developers
are starting to ship tmpfiles.d configuration files with their software.
By splitting the tmpfiles functionality in finit out into a separate executable
we are providing a useful piece of software that package managers can hook into.
This commit is contained in:
Aaron Andersen committed 2025-06-02 19:27:24 -04:00
1 parent d318aa00c3
commit 1921b3f2c5
5 files changed
+49 -49

No files matched your search

+39 -3
View File
@@ -23,12 +23,48 @@
#include "config.h" /* Generated by configure script */
#include <dirent.h>
#include <ftw.h>
#include <glob.h>
#include <libgen.h>
#include <grp.h>
#include <pwd.h>
#include <sys/sysmacros.h>
#include "finit.h"
#include <stdlib.h>
#include <string.h>
#ifdef _LIBITE_LITE
# include <libite/lite.h>
#else
# include <lite/lite.h>
#endif
#include "svc.h"
#include "helpers.h"
#include "tmpfiles.h"
#include "log.h"
#include "util.h"
int debug;
int runlevel;
char *osheading;
svc_t *wdog;
uev_ctx_t *ctx;
int syncsec;
int rescue;
char *network;
int cfglevel;
char *finit_rcsd;
char *sdown;
char *hostname;
int bootstrap;
int single;
int readiness;
char *finit_conf;
char *fstab;
int prevlevel;
int cmdlevel;
int kerndebug;
static int glob_do(const char *path, int (*cb)(const char *))
{
int rc = 0;
@@ -470,7 +506,7 @@ static void tmpfiles(char *line)
* before that to have Finit specific ones sorted first, and
* a configure prefix specific one after that for user needs.
*/
void tmpfilesd(void)
int main(int argc, char *argv[])
{
/* in priority order */
char *dir[] = {