mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
plugins: fix possible ordering bug; pidfile --> bootmisc
The recently updated pidfile plugin now also watches the subdirectories in /var/run, but for that to work it must witness the creation of these subdirectories. The bootmisc plugin creates several, e.g., /run/quagga/ in which PID files like zebra.pid are created. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
4a83c95d2b
commit
d068684154
2 files changed
+17
-4
No files matched your search
+4
-1
@@ -116,8 +116,10 @@ static void setup(void *arg)
|
|||||||
_d("System with new /run tmpfs ...");
|
_d("System with new /run tmpfs ...");
|
||||||
makedir("/run/lock", 1777);
|
makedir("/run/lock", 1777);
|
||||||
symlink("/run/lock", "/var/lock");
|
symlink("/run/lock", "/var/lock");
|
||||||
symlink("/run", "/var/run");
|
|
||||||
symlink("/dev/shm", "/run/shm");
|
symlink("/dev/shm", "/run/shm");
|
||||||
|
|
||||||
|
/* compat only, should really be set up by OS/dist */
|
||||||
|
symlink("/run", "/var/run");
|
||||||
} else {
|
} else {
|
||||||
makedir("/var/lock", 1777);
|
makedir("/var/lock", 1777);
|
||||||
makedir("/var/run", 0755);
|
makedir("/var/run", 0755);
|
||||||
@@ -191,6 +193,7 @@ static plugin_t plugin = {
|
|||||||
.hook[HOOK_BASEFS_UP] = {
|
.hook[HOOK_BASEFS_UP] = {
|
||||||
.cb = setup
|
.cb = setup
|
||||||
},
|
},
|
||||||
|
.depends = { "pidfile" },
|
||||||
};
|
};
|
||||||
|
|
||||||
PLUGIN_INIT(plugin_init)
|
PLUGIN_INIT(plugin_init)
|
||||||
|
|||||||
+13
-3
@@ -314,8 +314,18 @@ static void pidfile_init(void *arg)
|
|||||||
static struct context pidfile_ctx;
|
static struct context pidfile_ctx;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We require /var/run to be set up before calling pidfile_init(),
|
* When performing an `initctl reload` with one (unchanged) service
|
||||||
* so the bootmisc plugin must run first.
|
* depending on, e.g. `net/iface/lo`, its condition will not be set
|
||||||
|
* to ON by the pidfile plugin unless the netlink plugin hook runs
|
||||||
|
* first.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
*
|
||||||
|
* service <net/iface/lo> /sbin/dropbear ...
|
||||||
|
*
|
||||||
|
* Which provides the <svc/sbin/dropbear> condition, will not be
|
||||||
|
* set by pidfile.so during `initctl reload` because dropbear is
|
||||||
|
* still SIGSTP:ed waiting for <net/iface/lo>.
|
||||||
*/
|
*/
|
||||||
static plugin_t plugin = {
|
static plugin_t plugin = {
|
||||||
.name = __FILE__,
|
.name = __FILE__,
|
||||||
@@ -325,7 +335,7 @@ static plugin_t plugin = {
|
|||||||
.cb = pidfile_callback,
|
.cb = pidfile_callback,
|
||||||
.flags = PLUGIN_IO_READ,
|
.flags = PLUGIN_IO_READ,
|
||||||
},
|
},
|
||||||
.depends = { "bootmisc", "netlink" },
|
.depends = { "netlink" },
|
||||||
};
|
};
|
||||||
|
|
||||||
PLUGIN_INIT(plugin_init)
|
PLUGIN_INIT(plugin_init)
|
||||||
|
|||||||
Reference in new issue
Block a user