Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2223 - init.d-script for Dante sockd.
Summary: init.d-script for Dante sockd.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-29 05:02 UTC by Per Wigren
Modified: 2002-04-30 23:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Per Wigren 2002-04-29 05:02:17 UTC
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 Donny Davies (RETIRED) gentoo-dev 2002-04-30 23:39:09 UTC
good job!

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

thx for writing and contributing this ;)