]> git.pld-linux.org Git - packages/lvm2.git/commitdiff
Do not daemonize clvmd for systemd
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Thu, 1 Nov 2012 17:38:37 +0000 (18:38 +0100)
committerJacek Konieczny <jajcus@jajcus.net>
Thu, 1 Nov 2012 17:39:50 +0000 (18:39 +0100)
systemd can't handle re-exec of a forking process

startup status notification is re-implemented using st_notify(3)

clvmd.service
lvm2-sd_notify.patch [new file with mode: 0644]
lvm2.spec

index 4c6305507c6f3e2c3372c10650270450365e5b4d..061c4250eb60a433106bcfe0efbd6a041f65e21b 100644 (file)
@@ -4,7 +4,8 @@ After=syslog.target network.target corosync.service dlm.service
 Requires=dlm.service
 
 [Service]
-Type=forking
+Type=notify
+NotifyAccess=main
 EnvironmentFile=/etc/sysconfig/clvmd
 ExecStart=/usr/sbin/clvmd $CLVMDOPTS
 ExecReload=/usr/sbin/clvmd -R
diff --git a/lvm2-sd_notify.patch b/lvm2-sd_notify.patch
new file mode 100644 (file)
index 0000000..144523b
--- /dev/null
@@ -0,0 +1,32 @@
+diff -dur LVM2.2.02.98.orig/daemons/clvmd/Makefile.in LVM2.2.02.98/daemons/clvmd/Makefile.in
+--- LVM2.2.02.98.orig/daemons/clvmd/Makefile.in        2012-10-15 16:24:58.000000000 +0200
++++ LVM2.2.02.98/daemons/clvmd/Makefile.in     2012-11-01 18:35:19.000000000 +0100
+@@ -90,6 +90,8 @@
+ DEFS += -D_REENTRANT
+ CFLAGS += -fno-strict-aliasing
++LIBS += `pkg-config --libs libsystemd-daemon`
++
+ INSTALL_TARGETS = \
+       install_clvmd
+diff -dur LVM2.2.02.98.orig/daemons/clvmd/clvmd.c LVM2.2.02.98/daemons/clvmd/clvmd.c
+--- LVM2.2.02.98.orig/daemons/clvmd/clvmd.c    2012-10-15 16:24:58.000000000 +0200
++++ LVM2.2.02.98/daemons/clvmd/clvmd.c 2012-11-01 18:34:20.000000000 +0100
+@@ -41,6 +41,8 @@
+ #include <sys/un.h>
+ #include <sys/utsname.h>
++#include <systemd/sd-daemon.h>
++
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
+@@ -599,6 +601,7 @@
+               clops->cluster_init_completed();
+       DEBUGLOG("clvmd ready for work\n");
++      sd_notify(0, "READY=1");
+       child_init_signal(SUCCESS);
+       /* Try to shutdown neatly */
index 51cfa321b01cd4e61190238802df488bd2157242..0dd9cdebc024402d22c91fe881573bdaea5aa9c4 100644 (file)
--- a/lvm2.spec
+++ b/lvm2.spec
@@ -50,6 +50,7 @@ Patch3:               %{name}-pld_init.patch
 Patch4:                dl-dlsym.patch
 Patch5:                %{name}-wrapper.patch
 Patch6:                %{name}-lvm_path.patch
+Patch7:                %{name}-sd_notify.patch
 URL:           http://sources.redhat.com/lvm2/
 BuildRequires: autoconf >= 2.61
 BuildRequires: automake
@@ -75,6 +76,7 @@ BuildConflicts:       device-mapper-dietlibc
 %if %{with cluster}
 BuildRequires: corosync-devel
 BuildRequires: dlm-devel >= 3.99.5
+BuildRequires: systemd-devel
 %endif
 Requires(post,preun,postun):   systemd-units >= 38
 Requires:      device-mapper >= %{version}-%{release}
@@ -259,6 +261,7 @@ potrzeby initrd.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 # do not force --export-symbol linker option for e.g. statically linked executables
 # -rdynamic compiler option drives linker in the right way.
This page took 0.152555 seconds and 4 git commands to generate.