Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 425740

Summary: net-misc/sslh - SSLH init script successfully starts daemon but thinks it's failed
Product: Gentoo Linux Reporter: Jamie Furtner <jamie>
Component: Current packagesAssignee: Michael Palimaka (kensington) <kensington>
Status: RESOLVED FIXED    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: diff file for sslh init script
emerge --info sslh
/etc/init.d/sslh diff

Description Jamie Furtner 2012-07-10 21:11:35 UTC
Created attachment 317858 [details, diff]
diff file for sslh init script

SSLH init script successfully starts daemon but thinks it's failed.

Startup:
jfurtner@nemesis /etc/init.d $ sudo /etc/init.d/sslh start
 * Caching service dependencies ...                                                                                           [ ok ]
 * Starting sslh ...
 * start-stop-daemon: /usr/bin/sslh died                                                                                      [ !! ]
 * ERROR: sslh failed to start
jfurtner@nemesis /etc/init.d $ ps -ef | grep sslh
nobody   13097     1  0 15:00 ?        00:00:00 /usr/bin/sslh --listen 0.0.0.0 442 --ssh localhost 22 --ssl localhost 441 --openvpn localhost 1194 --user nobody --pidfile /var/run/sslh.pid
jfurtner 13174 21599  0 15:00 pts/2    00:00:00 grep --colour=auto sslh
jfurtner@nemesis /etc/init.d $ sudo grep sslh- /var/log/secure | tail -n1
Jul 10 15:00:30 nemesis sslh[13097]: sslh-select v1.13b started

SSLH was successfully started but start-stop-daemon thinks it died. Apply the attached patch which tells start-stop-daemon to wait for one second and then look for the PID file.

jfurtner@nemesis /etc/init.d $ sudo ./sslh start
 * Caching service dependencies ...                                                                                           [ ok ]
 * Starting sslh ...                                                                                                          [ ok ]
jfurtner@nemesis /etc/init.d $ sudo ps -ef | grep sslh
nobody   18456     1  0 15:03 ?        00:00:00 /usr/bin/sslh --listen 0.0.0.0 442 --ssh localhost 22 --ssl localhost 441 --openvpn localhost 1194 --user nobody --pidfile /var/run/sslh.pid
jfurtner 18567 21599  0 15:03 pts/2    00:00:00 grep --colour=auto sslh
jfurtner@nemesis /etc/init.d $ sudo grep sslh- /var/log/secure | tail -n1
Jul 10 15:03:48 nemesis sslh[18456]: sslh-select v1.13b started

The patch works if /usr/bin/sslh softlink is pointing at /usr/bin/sslh-fork or /usr/bin/sslh-select.
Comment 1 Michael Palimaka (kensington) gentoo-dev 2012-07-11 10:10:43 UTC
Thanks for the report and patch. I'm keen to fix the issue, but unfortunately I cannot reproduce locally, and would like to avoid --wait if at all possible.

To that end, could you please attach the output of emerge --info sslh ? Does the extra --pidfile argument solve the problem, or does only --wait fix it for you?
Comment 2 Jamie Furtner 2012-07-11 15:06:23 UTC
Created attachment 317930 [details]
emerge --info sslh
Comment 3 Jamie Furtner 2012-07-11 15:10:46 UTC
I never thought to try just passing --pidfile to start-stop-daemon. I've tried it and it works correctly. I'll update the patch in a moment.
Comment 4 Jamie Furtner 2012-07-11 15:11:45 UTC
Created attachment 317932 [details, diff]
/etc/init.d/sslh diff
Comment 5 Michael Palimaka (kensington) gentoo-dev 2012-07-11 15:52:49 UTC
Thanks! This is now fixed in CVS, please reopen if you have further issues.

+  11 Jul 2012; Michael Palimaka <kensington@gentoo.org> +sslh-1.13-r1.ebuild,
+  -sslh-1.13.ebuild, files/sslh.init.d-2:
+  Revision bump to fix issue with init script where the daemon is successfully
+  started, but is reported as failed. Thanks to Jamie Furtner <jamie@furtner.ca>
+  for the patch.