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:
Joachim Wiberg committed 2021-02-09 15:25:35 +01:00
1 parent 4a83c95d2b
commit d068684154
2 files changed
+17 -4

No files matched your search

+13 -3
View File
@@ -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)