stunnel fails to start because it doesn't have permissions to create the file /var/run/stunnel/stunnel.pid. This is what the error messages look like in the everything log: everything/log-2012-09-26-00:46:04:Sep 25 20:34:19 [stunnel] LOG3[1280:1077577984]: Cannot create pid file /var/run/stunnel.pid everything/log-2012-09-26-00:46:04:Sep 25 20:34:19 [stunnel] LOG3[1280:1077577984]: create: Permission denied (13) Reproducible: Always Steps to Reproduce: 1.Install and configure stunnel. 2.Run rc-add stunnel default. 3.Reboot. 4.Run rc-status. Actual Results: # rc-status Runlevel: default stunnel [ crashed ] Expected Results: # rc-status Runlevel: default stunnel [ started ] I fixed the problem by making a code change to /etc/init.d/stunnel: ... start() { get_config || return 1 ebegin "Starting ${SVCNAME}" if [ ! -e "${PIDFILE}" ] ; then PIDFILEDIR=${PIDFILE%/*} if [ ! -e "${PIDFILEDIR}" ] ; then mkdir -p "${PIDFILEDIR}" chown stunnel:stunnel "${PIDFILEDIR}" fi fi start-stop-daemon --start --pidfile "${PIDFILE}" ${CHROOT} \ --exec /usr/bin/stunnel -- ${STUNNEL_CONFIGFILE} ${STUNNEL_OPTIONS} eend $? "Failed to start ${SVCNAME}" } ... The directory /var/run/stunnel doesn't stay between reboots, so my code change created it if it's missing and makes the stunnel user the owner.
I experienced the same issue. Your fix worked as a work-around. This seems to be due to /var/run now being a sym-link to /run which is a tmpfs.
Same problem here after updating to openrc-0.11.5. I solved it by simply adding "mkdir -p /var/run/stunnel && chown stunnel:stunnel /var/run/stunnel" at the beginning of the start() block in /etc/init.d/stunnel.
Just use checkpath... start() { get_config || return 1 checkpath -d -m 0755 -o stunnel:stunnel -q $(dirname ${PIDFILE}) ... }
Created attachment 333074 [details] stunnel.initd-start-stop-daemon init-script using checkpath
Fixed and pushed to the tree. Thanks for the patch!