When running: /etc/init.d/stunnel start It complains: stunnel | * Starting stunnel ... stunnel | * error starting: /etc/stunnel/stunnel.conf [ !! ] The process is created, and it works correctly. Digging into the init script I find that the error indicates that it can't find the pid file as specified in the configuration file. Checking in the file system, I see that it was created. Apparently stunnel will fork into the background before creating the pid file, so there's a race condition that on my system is causing it to consistently fail that check. If I add another display message after starting the daemon but before checking for the pid file, the script reports success. While the correct fix is to push this upstream to eliminate the race condition in the creation of the pid file, a workaround is to update the check for the pid file to first sleep a half-second if the file isn't there. This change makes it work for me: elif ${DAEMON} ${ARGS} ; then if ! test -f ${CHROOT}/${PIDFILE} ; then sleep 0.5s # give the daemon time to create the pid file fi if test -f ${CHROOT}/${PIDFILE} ; then einfo " ${file}" else eerror " error starting: ${file}" fi fi
Thanks for reporting the bug. I had noticed that problem as well but didn't get a chance to look into it further. While this fix is kind of a workaround I think its the most simple approach to it. I just committed your fix to portage.