I noticed that Dante didn't come with a start/stop-script so I wrote one
myself.. sockd doesn't create a pidfile so I had to use --make-pidfile --
background, but it seems to work fine!
Here it is:
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
depend() {
need net
}
checkconfig() {
if [ ! -f /etc/socks/sockd.conf ]
then
eerror "Please create /etc/socks/sockd.conf!"
eerror "Example configfiles can be found
in /usr/share/doc/dante-x.x.x/example/"
return 1
fi
return 0
}
start() {
checkconfig || return $?
ebegin "Starting Dante sockd"
start-stop-daemon --start --quiet --pidfile /var/run/sockd.pid \
--make-pidfile --background --exec /usr/sbin/sockd
eend $? "Failed to start sockd"
}
stop() {
ebegin "Stopping Dante sockd"
start-stop-daemon --stop --quiet --pidfile /var/run/sockd.pid
eend $? "Failed to stop sockd"
# clean stale pidfile
if [ -f /var/run/sockd.pid ]
then
rm -f /var/run/sockd.pid
fi
}