diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-11-09 12:08:12 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-11-09 12:08:12 +0000 |
commit | 546e58a0627395a03d7532194103564d3349f4d5 (patch) | |
tree | e261918c88a5e68a670cdbbbbb7749b0b527a329 | |
parent | bf9893f6d338f5dccd7e9cae9b682390c2eaaf4e (diff) | |
download | pykolab-546e58a0627395a03d7532194103564d3349f4d5.tar.gz |
Install sysvinit rc scripts for kolabd and kolab-saslauthd
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | kolabd/Makefile.am | 6 | ||||
-rw-r--r-- | kolabd/kolabd.sysvinit | 110 | ||||
-rw-r--r-- | pykolab.spec.in | 34 | ||||
-rw-r--r-- | saslauthd/kolab-saslauthd.sysvinit | 110 |
5 files changed, 258 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index ba48a4f..c95d1b9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -163,7 +163,6 @@ install-exec-local: $(DESTDIR)/$(localstatedir)/log/kolab $(INSTALL) -p -m 755 conf.py $(DESTDIR)/$(sbindir)/kolab-conf $(INSTALL) -p -m 755 kolab.py $(DESTDIR)/$(sbindir)/kolab - $(INSTALL) -p -m 755 kolabd.py $(DESTDIR)/$(sbindir)/kolabd $(INSTALL) -p -m 755 kolabtest.py $(DESTDIR)/$(bindir)/kolab-test $(INSTALL) -p -m 644 cyruslib.py $(DESTDIR)/$(pythondir) $(INSTALL) -p -m 755 bin/kolab_parse_telemetry.py $(DESTDIR)/$(sbindir)/kolab_parse_telemetry diff --git a/kolabd/Makefile.am b/kolabd/Makefile.am index 7d40cb0..fa79899 100644 --- a/kolabd/Makefile.am +++ b/kolabd/Makefile.am @@ -1,2 +1,8 @@ +EXTRA_DIST = kolabd.sysvinit + kolabddir = $(pythondir)/kolabd kolabd_PYTHON = $(wildcard *.py) + +install-exec-local: + mkdir -p $(DESTDIR)/$(sbindir) + $(INSTALL) -p -m 755 kolabd.py $(DESTDIR)/$(sbindir)/kolabd diff --git a/kolabd/kolabd.sysvinit b/kolabd/kolabd.sysvinit new file mode 100644 index 0000000..01e05e5 --- /dev/null +++ b/kolabd/kolabd.sysvinit @@ -0,0 +1,110 @@ +#! /bin/bash +# +# kolab-saslauthd Start/Stop the SASL authentication daemon +# +# chkconfig: - 65 10 +# description: The Kolab saslauthd is a server process which handles \ +# authentication requests on behalf of the cyrus-sasl library. +# processname: kolab-saslauthd + +### BEGIN INIT INFO +# Provides: kolab-saslauthd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Short-Description: Start/Stop the Kolab SASL authentication daemon +# Description: The Kolab saslauthd is a server process which handles \ +# authentication requests on behalf of the cyrus-sasl library. +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +# Source our configuration file for these variables. +SOCKETDIR=/var/run/saslauthd +FLAGS= +if [ -f /etc/sysconfig/kolab-saslauthd ] ; then + . /etc/sysconfig/kolab-saslauthd +fi + +RETVAL=0 + +# Set up some common variables before we launch into what might be +# considered boilerplate by now. +prog=kolab-saslauthd +path=/usr/sbin/kolab-saslauthd +lockfile=/var/lock/subsys/$prog +pidfile=/var/run/kolab-saslauthd/kolab-saslauthd.pid + +start() { + [ -x $path ] || exit 5 + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $path -m $SOCKETDIR -a $MECH $FLAGS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + reload + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? diff --git a/pykolab.spec.in b/pykolab.spec.in index 0c44408..511b063 100644 --- a/pykolab.spec.in +++ b/pykolab.spec.in @@ -105,6 +105,9 @@ Kolab SMTP Access Policy for Postfix rm -rf %{buildroot} make install DESTDIR=%{buildroot} +%{__install} -p -m 755 saslauthd/kolab-saslauthd.sysvinit %{buildroot}/%{_initddir}/kolab-saslauthd +%{__install} -p -m 755 saslauthd/kolabd.sysvinit %{buildroot}/%{_initddir}/kolabd + %find_lang pykolab %pre @@ -137,6 +140,32 @@ if [ $1 -gt 1 ] ; then usermod -d %{_localstatedir}/lib/%{kolab_user} %{kolabr_user} &>/dev/null || : fi +%post -n kolab-saslauthd +if [ $1 -eq 1 ] ; then + chkconfig --add kolab-saslauthd +else + /sbin/service kolab-saslauthd condrestart +fi + +%preun -n kolab-saslauthd +if [ $1 = 0 ]; then + /sbin/service kolab-saslauthd stop > /dev/null 2>&1 + /sbin/chkconfig --del kolab-saslauthd +fi + +%post -n kolab-server +if [ $1 -eq 1 ] ; then + chkconfig --add kolabd +else + /sbin/service kolabd condrestart +fi + +%preun -n kolab-server +if [ $1 = 0 ]; then + /sbin/service kolabd stop > /dev/null 2>&1 + /sbin/chkconfig --del kolabd +fi + %clean rm -rf %{buildroot} @@ -186,8 +215,8 @@ rm -rf %{buildroot} %files -n kolab-saslauthd %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING -%attr(0755,root,root) %{_initddir}/kolab-saslauthd -%attr(0750,root,root) %{_sbindir}/kolab-saslauthd +%{_initddir}/kolab-saslauthd +%{_sbindir}/kolab-saslauthd %{python_sitelib}/saslauthd/ %dir %{_localstatedir}/run/kolab-saslauthd %dir %{_localstatedir}/run/saslauthd @@ -195,6 +224,7 @@ rm -rf %{buildroot} %files -n kolab-server %defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING +%{_initddir}/kolabd %{_sbindir}/kolabd %{python_sitelib}/kolabd/ diff --git a/saslauthd/kolab-saslauthd.sysvinit b/saslauthd/kolab-saslauthd.sysvinit new file mode 100644 index 0000000..01e05e5 --- /dev/null +++ b/saslauthd/kolab-saslauthd.sysvinit @@ -0,0 +1,110 @@ +#! /bin/bash +# +# kolab-saslauthd Start/Stop the SASL authentication daemon +# +# chkconfig: - 65 10 +# description: The Kolab saslauthd is a server process which handles \ +# authentication requests on behalf of the cyrus-sasl library. +# processname: kolab-saslauthd + +### BEGIN INIT INFO +# Provides: kolab-saslauthd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Short-Description: Start/Stop the Kolab SASL authentication daemon +# Description: The Kolab saslauthd is a server process which handles \ +# authentication requests on behalf of the cyrus-sasl library. +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +# Source our configuration file for these variables. +SOCKETDIR=/var/run/saslauthd +FLAGS= +if [ -f /etc/sysconfig/kolab-saslauthd ] ; then + . /etc/sysconfig/kolab-saslauthd +fi + +RETVAL=0 + +# Set up some common variables before we launch into what might be +# considered boilerplate by now. +prog=kolab-saslauthd +path=/usr/sbin/kolab-saslauthd +lockfile=/var/lock/subsys/$prog +pidfile=/var/run/kolab-saslauthd/kolab-saslauthd.pid + +start() { + [ -x $path ] || exit 5 + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $path -m $SOCKETDIR -a $MECH $FLAGS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + reload + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? |