Bug 2223 - init.d-script for Dante sockd.
Bug#: 2223 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: woodchip@gentoo.org Reported By: tuxie@dekadance.se
Component: Unspecified
URL: 
Summary: init.d-script for Dante sockd.
Keywords:  
Status Whiteboard: 
Opened: 2002-04-29 05:02 0000
Description:   Opened: 2002-04-29 05:02 0000
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
}

------- Comment #1 From Donny Davies (RETIRED) 2002-04-30 23:39:09 0000 -------
good job!

okay, added in dante-1.1.9-r1.ebuild.

thx for writing and contributing this ;)