diff options
author | Alin Năstac <mrness@gentoo.org> | 2009-12-12 10:53:15 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2009-12-12 10:53:15 +0000 |
commit | 6cd8cdf67a4567164f56a6be097bcc9718f39752 (patch) | |
tree | 67242cb8e4f5be2f03cee86b3c624b74700f8556 /mail-filter | |
parent | Initial import of app-laptop/batterymon. (diff) | |
download | gentoo-2-6cd8cdf67a4567164f56a6be097bcc9718f39752.tar.gz gentoo-2-6cd8cdf67a4567164f56a6be097bcc9718f39752.tar.bz2 gentoo-2-6cd8cdf67a4567164f56a6be097bcc9718f39752.zip |
Force pidfile usage (#291651).
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/sid-milter/ChangeLog | 5 | ||||
-rwxr-xr-x | mail-filter/sid-milter/files/sid-filter.init | 34 |
2 files changed, 19 insertions, 20 deletions
diff --git a/mail-filter/sid-milter/ChangeLog b/mail-filter/sid-milter/ChangeLog index 491d98204ce7..facfdfc783cf 100644 --- a/mail-filter/sid-milter/ChangeLog +++ b/mail-filter/sid-milter/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for mail-filter/sid-milter # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/ChangeLog,v 1.15 2009/12/05 06:49:37 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/ChangeLog,v 1.16 2009/12/12 10:53:15 mrness Exp $ + + 12 Dec 2009; Alin Năstac <mrness@gentoo.org> files/sid-filter.init: + Force pidfile usage (#291651). *sid-milter-1.0.0-r4 (05 Dec 2009) diff --git a/mail-filter/sid-milter/files/sid-filter.init b/mail-filter/sid-milter/files/sid-filter.init index 1fdc734fda73..d2f735bbcbfe 100755 --- a/mail-filter/sid-milter/files/sid-filter.init +++ b/mail-filter/sid-milter/files/sid-filter.init @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/files/sid-filter.init,v 1.2 2009/12/05 06:49:37 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/files/sid-filter.init,v 1.3 2009/12/12 10:53:15 mrness Exp $ depend() { # need net @@ -25,40 +25,36 @@ parse_opts() { filter_user=milter SID_FILTER_OPTS="${SID_FILTER_OPTS} -u ${filter_user}" fi + if [ -z "${filter_pid}" ]; then + filter_pid="/var/run/sid-filter.pid" + SID_FILTER_OPTS="${SID_FILTER_OPTS} -P ${filter_pid}" + fi } start() { - local filter_user= filter_pid= SSD_OPTS= + local filter_user= filter_pid= parse_opts - if [ -n "${filter_pid}" ]; then - if ! (touch ${filter_pid} && chown ${filter_user} ${filter_pid}) ; then - eerror "Failed to create pidfile" - return 1 - fi - SSD_OPTS="--pidfile ${filter_pid}" + if ! (touch ${filter_pid} && chown ${filter_user} ${filter_pid}) ; then + eerror "Failed to create pidfile" + return 1 fi ebegin "Starting Sender-ID Filter" - start-stop-daemon --start --quiet --background ${SSD_OPTS} \ - --exec /usr/bin/sid-filter -- ${SID_FILTER_OPTS} + start-stop-daemon --start --exec /usr/bin/sid-filter -- ${SID_FILTER_OPTS} eend $? } stop() { - local filter_user= filter_pid= SSD_OPTS= + local filter_user= filter_pid= parse_opts - if [ -n "${filter_pid}" ]; then - SSD_OPTS="--pidfile ${filter_pid}" - fi - + ebegin "Stopping Sender-ID Filter" - start-stop-daemon --stop --quiet --name sid-filter ${SSD_OPTS} + start-stop-daemon --stop --quiet --name sid-filter --pidfile ${filter_pid} eend $? - if [ $? = 0 -a -n "${filter_pid}" -a -f "${filter_pid}" ]; then + if [ $? = 0 -a -f "${filter_pid}" ]; then rm ${filter_pid} fi } - |