summaryrefslogtreecommitdiff
path: root/daemons/cmirrord
diff options
context:
space:
mode:
authorFerenc Wágner <wferi@niif.hu>2015-07-08 14:41:22 +0200
committerHeinz Mauelshagen <heinzm@redhat.com>2015-08-20 19:06:47 +0200
commitc0d6056870769a1f64204532471a8f9bd398093e (patch)
treef78496a46313218a9ef7aa6bbf8fabffe118a124 /daemons/cmirrord
parent23770214a9ac844e72e62de589a4d61cd0e125bc (diff)
downloadlvm2-c0d6056870769a1f64204532471a8f9bd398093e.tar.gz
cmirrord: move generic setup from daemonize() to init_all()
Apply pidfile creation, removal and signal setup to foreground processes too.
Diffstat (limited to 'daemons/cmirrord')
-rw-r--r--daemons/cmirrord/clogd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/daemons/cmirrord/clogd.c b/daemons/cmirrord/clogd.c
index 86d06bda9..b4736e1d3 100644
--- a/daemons/cmirrord/clogd.c
+++ b/daemons/cmirrord/clogd.c
@@ -209,6 +209,16 @@ static void daemonize(void)
}
LOG_OPEN("cmirrord", LOG_PID, LOG_DAEMON);
+}
+
+/*
+ * init_all
+ *
+ * Initialize modules. Exit on failure.
+ */
+static void init_all(void)
+{
+ int r;
(void) dm_prepare_selinux_context(CMIRRORD_PIDFILE, S_IFREG);
if (dm_create_lockfile(CMIRRORD_PIDFILE) == 0)
@@ -227,16 +237,6 @@ static void daemonize(void)
signal(SIGUSR2, &sig_handler);
sigemptyset(&signal_mask);
signal_received = 0;
-}
-
-/*
- * init_all
- *
- * Initialize modules. Exit on failure.
- */
-static void init_all(void)
-{
- int r;
if ((r = init_local()) ||
(r = init_cluster())) {