/[gentoo-x86]/net-misc/stunnel/files/stunnel.initd-start-stop-daemon
Gentoo

Contents of /net-misc/stunnel/files/stunnel.initd-start-stop-daemon

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Jun 16 16:04:11 2013 UTC (17 months, 1 week ago) by blueness
Branch: MAIN
Changes since 1.2: +3 -2 lines
Version bump, security bug #460278

(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

1 #!/sbin/runscript
2 # Copyright 1999-2013 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/files/stunnel.initd-start-stop-daemon,v 1.2 2012/12/25 04:25:06 ramereth Exp $
5
6 SERVICENAME=${SVCNAME#*.}
7 SERVICENAME=${SERVICENAME:-stunnel}
8 STUNNEL_CONFIGFILE=${STUNNEL_CONFIGFILE:-/etc/stunnel/${SERVICENAME}.conf}
9
10 depend() {
11 need net
12 before logger
13 }
14
15 get_config() {
16 if [ ! -e ${STUNNEL_CONFIGFILE} ] ; then
17 eerror "You need to create ${STUNNEL_CONFIGFILE} first."
18 return 1
19 fi
20 CHROOT=$(grep "^chroot" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
21 [ -n "${CHROOT}" ] && CHROOT="--chroot ${CHROOT}"
22 PIDFILE=$(grep "^pid" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
23 PIDFILE=${PIDFILE:-/var/run/stunnel/${SERVICENAME}.pid}
24 }
25
26 start() {
27 get_config || return 1
28 checkpath -d -m 0775 -o root:stunnel /var/run/stunnel
29 if [ "$(dirname ${PIDFILE})" != "/var/run" ]; then
30 checkpath -d -m 0755 -o stunnel:stunnel -q $(dirname ${PIDFILE})
31 fi
32 ebegin "Starting ${SVCNAME}"
33 start-stop-daemon --start --pidfile "${PIDFILE}" ${CHROOT} \
34 --exec /usr/bin/stunnel -- ${STUNNEL_CONFIGFILE} ${STUNNEL_OPTIONS}
35 eend $? "Failed to start ${SVCNAME}"
36 }
37
38 stop() {
39 get_config || return 1
40 ebegin "Stopping ${SVCNAME}"
41 start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
42 eend $? "Failed to stop ${SVCNAME}"
43 }

  ViewVC Help
Powered by ViewVC 1.1.20