Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

tracd debian init script

tracd init script on debian stable. consists of two parts, /etc/init.d/tracd and /etc/default/tracd

This is /etc/init.d/tracd

#! /bin/sh
#
# tracd           Trac standalone server daemon
#
# Author: cocoaberry
#

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Trac standalone server"
NAME=tracd
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# defaults for tracd
TRACD_PORT=8080
TRACD_BIND_ADDRESS=0.0.0.0
TRACD_EXTRA_OPTS=

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
        . /etc/default/$NAME
fi

#
# Function that starts the daemon/service.
#
d_start() {
        start-stop-daemon --start --background --make-pidfile --quiet \
                --pidfile $PIDFILE --chuid $TRACD_USER \
                --exec $DAEMON -- $TRACD_EXTRA_OPTS --port $TRACD_PORT --hostname $TRACD_BIND_ADDRESS $TRACD_ENVIRONMENTS
}

#
# Function that stops the daemon/service.
#
d_stop() {
        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
                --name $NAME
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        #
        # If the "reload" option is implemented, move the "force-reload"
        # option to the "reload" entry above. If not, "force-reload" is
        # just the same as "restart".
        #
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 1
        d_start
        echo "."
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0



This is /etc/default/tracd

# Default settings for tracd. This file is sourced by
# /etc/init.d/tracd

# MAJOR HACK - disable globbing so $TRACD_EXTRA_OPTS on cmdline won't expand
# the *
set -f
# The user that tracd runs as
TRACD_USER=tracd
# The environments that tracd manages. If more than one, separate
# with spaces
TRACD_ENVIRONMENTS=/home/tracd/trac-env
# Extra options to tracd
TRACD_EXTRA_OPTS="--auth *,/home/tracd/trac.htdigest,TracRealm"
# The port that tracd binds to. The default is 8080
# TRACD_PORT=8080
# The addresses that tracd binds to. The default is 0.0.0.0
# TRACD_BIND_ADDRESS=0.0.0.0

Stop bell/beep in bash

setterm -blength 0


Sets the bell length to zero for all applications
« Newer Snippets
Older Snippets »
2 total  XML / RSS feed