Hi,
as title.
my /etc/rc.d/init.d/sslh
contains this code:
Code:
PIDFILE="/home/MYUSERNAME/sslh"
start() {
echo -n "Starting SSL-SSH-Switch: "
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo sslh already running: $PID
exit 2;
else
daemon --user MYUSERNAME $SSLH $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $PIDFILE
ip rule add fwmark 0x1 lookup 100;
ip route add local 0.0.0.0/0 dev lo table 100;
return $RETVAL
fi
}
stop() {
echo -n "Shutting down SSL-SSH-Switch: "
echo
killproc sslh
rm -f $PIDFILE
ip rule del fwmark 0x1 lookup 100;
ip route del local 0.0.0.0/0 dev lo table 100;
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status sslh
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|restart}"
exit 1
;;
esac
exit $?
if I run the
service sslh start
from a command line the PID file is correctly created,
if I run
service sslh stop
from a command line the PID file is correctly deleted.
If I reboot while the service is started, the PID file is not deleted, this means that at the next
boot the service doesn't start because it thinks that it is already started.
I don't know if the stop() method is called on reboot,
I don't see any "Shutting down SSL-SSH-Switch: " message on reboot.
Any idea on what is the problem and a possible solution to it?
Thanks.