mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07: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:
+4
-1
@@ -116,8 +116,10 @@ static void setup(void *arg)
|
||||
_d("System with new /run tmpfs ...");
|
||||
makedir("/run/lock", 1777);
|
||||
symlink("/run/lock", "/var/lock");
|
||||
symlink("/run", "/var/run");
|
||||
symlink("/dev/shm", "/run/shm");
|
||||
|
||||
/* compat only, should really be set up by OS/dist */
|
||||
symlink("/run", "/var/run");
|
||||
} else {
|
||||
makedir("/var/lock", 1777);
|
||||
makedir("/var/run", 0755);
|
||||
@@ -191,6 +193,7 @@ static plugin_t plugin = {
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = setup
|
||||
},
|
||||
.depends = { "pidfile" },
|
||||
};
|
||||
|
||||
PLUGIN_INIT(plugin_init)
|
||||
|
||||
+13
-3
@@ -314,8 +314,18 @@ static void pidfile_init(void *arg)
|
||||
static struct context pidfile_ctx;
|
||||
|
||||
/*
|
||||
* We require /var/run to be set up before calling pidfile_init(),
|
||||
* so the bootmisc plugin must run first.
|
||||
* When performing an `initctl reload` with one (unchanged) service
|
||||
* 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 = {
|
||||
.name = __FILE__,
|
||||
@@ -325,7 +335,7 @@ static plugin_t plugin = {
|
||||
.cb = pidfile_callback,
|
||||
.flags = PLUGIN_IO_READ,
|
||||
},
|
||||
.depends = { "bootmisc", "netlink" },
|
||||
.depends = { "netlink" },
|
||||
};
|
||||
|
||||
PLUGIN_INIT(plugin_init)
|
||||
|
||||
Reference in New Issue
Block a user