Reviewed-by: Steven Dake <[email protected]> Regards -steve
On 08/08/2011 04:04 AM, Angus Salkeld wrote: > Signed-off-by: Angus Salkeld <[email protected]> > --- > configure.ac | 8 ++++++++ > corosync.spec.in | 12 ++++++++++++ > init/.gitignore | 2 ++ > init/Makefile.am | 15 +++++++++++---- > init/corosync-notifyd.service.in | 11 +++++++++++ > init/corosync.service.in | 12 ++++++++++++ > 6 files changed, 56 insertions(+), 4 deletions(-) > create mode 100644 init/corosync-notifyd.service.in > create mode 100644 init/corosync.service.in > > diff --git a/configure.ac b/configure.ac > index e00edeb..563f799 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -279,6 +279,11 @@ AC_ARG_ENABLE([augeas], > [ enable_augeas="no" ]) > AM_CONDITIONAL(INSTALL_AUGEAS, test x$enable_augeas = xyes) > > +AC_ARG_ENABLE([systemd], > + [ --enable-systemd : Install systemd service > files],, > + [ enable_systemd="no" ]) > +AM_CONDITIONAL(INSTALL_SYSTEMD, test x$enable_systemd = xyes) > + > AC_ARG_WITH([initddir], > [ --with-initddir=DIR : path to init script directory. ], > [ INITDDIR="$withval" ], > @@ -448,6 +453,9 @@ fi > if test "x${enable_augeas}" = xyes; then > PACKAGE_FEATURES="$PACKAGE_FEATURES augeas" > fi > +if test "x${enable_systemd}" = xyes; then > + PACKAGE_FEATURES="$PACKAGE_FEATURES systemd" > +fi > > if test "x${enable_snmp}" = xyes; then > SNMPCONFIG="" > diff --git a/corosync.spec.in b/corosync.spec.in > index 5eba3bc..b864087 100644 > --- a/corosync.spec.in > +++ b/corosync.spec.in > @@ -11,6 +11,7 @@ > %bcond_with snmp > %bcond_with dbus > %bcond_with rdma > +%bcond_with systemd > > Name: corosync > Summary: The Corosync Cluster Engine and Application Programming Interfaces > @@ -46,6 +47,9 @@ BuildRequires: net-snmp-devel > %if %{with dbus} > BuildRequires: dbus-devel > %endif > +%if %{with systemd} > +BuildRequires: systemd-units > +%endif > > BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) > > @@ -83,6 +87,9 @@ export rdmacm_LIBS=-lrdmacm \ > %if %{with rdma} > --enable-rdma \ > %endif > +%if %{with systemd} > + --enable-systemd \ > +%endif > --with-initddir=%{_initrddir} > > make %{_smp_mflags} > @@ -146,8 +153,13 @@ fi > %if %{with snmp} > %{_datadir}/snmp/mibs/COROSYNC-MIB.txt > %endif > +%if %{with systemd} > +%{_unitdir}/corosync.service > +%{_unitdir}/corosync-notifyd.service > +%else > %{_initrddir}/corosync > %{_initrddir}/corosync-notifyd > +%endif > %dir %{_libexecdir}/lcrso > %{_libexecdir}/lcrso/coroparse.lcrso > %{_libexecdir}/lcrso/objdb.lcrso > diff --git a/init/.gitignore b/init/.gitignore > index 0a75c32..34e4cb8 100644 > --- a/init/.gitignore > +++ b/init/.gitignore > @@ -1,2 +1,4 @@ > generic > notifyd > +corosync.service > +corosync-notifyd.service > diff --git a/init/Makefile.am b/init/Makefile.am > index 0ca9ee9..90d49c4 100644 > --- a/init/Makefile.am > +++ b/init/Makefile.am > @@ -34,9 +34,14 @@ > > MAINTAINERCLEANFILES = Makefile.in > > -EXTRA_DIST = generic.in notifyd.in > +EXTRA_DIST = generic.in notifyd.in corosync.service.in > corosync-notifyd.service.in > > +if INSTALL_SYSTEMD > +systemdconfdir = /lib/systemd/system > +systemdconf_DATA = corosync.service corosync-notifyd.service > +else > target_INIT = generic notifyd > +endif > > %: %.in Makefile > rm -f $@-t $@ > @@ -46,14 +51,15 @@ target_INIT = generic notifyd > -e 's#@''INITDDIR@#$(INITDDIR)#g' \ > -e 's#@''LOCALSTATEDIR@#$(localstatedir)#g' \ > $< > $@-t > - chmod 0755 $@-t > mv $@-t $@ > > -all-local: $(target_INIT) > +all-local: $(target_INIT) $(systemdconf_DATA) > > clean-local: > - rm -rf $(target_INIT) > + rm -rf $(target_INIT) $(systemdconf_DATA) > > +if INSTALL_SYSTEMD > +else > install-exec-local: > $(INSTALL) -d $(DESTDIR)/$(INITDDIR) > $(INSTALL) -m 755 generic $(DESTDIR)/$(INITDDIR)/corosync > @@ -62,3 +68,4 @@ install-exec-local: > uninstall-local: > cd $(DESTDIR)/$(INITDDIR) && \ > rm -f corosync corosync-notifyd > +endif > diff --git a/init/corosync-notifyd.service.in > b/init/corosync-notifyd.service.in > new file mode 100644 > index 0000000..26a278a > --- /dev/null > +++ b/init/corosync-notifyd.service.in > @@ -0,0 +1,11 @@ > +[Unit] > +Description=Corosync Dbus and snmp notifier > +Wants=corosync.service > + > +[Service] > +EnvironmentFile=@SYSCONFIGDIR@/corosync-notifyd > +ExecStart=@SBINDIR@/corosync-notifyd -f $OPTIONS > +Type=simple > + > +[Install] > +WantedBy=multi-user.target > diff --git a/init/corosync.service.in b/init/corosync.service.in > new file mode 100644 > index 0000000..8cc692b > --- /dev/null > +++ b/init/corosync.service.in > @@ -0,0 +1,12 @@ > +[Unit] > +Description=Corosync Cluster Engine > +ConditionKernelCommandLine=!nocluster > +#Conflicts=cman.service > + > +[Service] > +ExecStart=@SBINDIR@/corosync > +Type=forking > +#RestartSec=90s > + > +[Install] > +WantedBy=multi-user.target _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
