File: init

package info (click to toggle)
xfstt 1.7-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,972 kB
  • ctags: 1,556
  • sloc: cpp: 8,458; sh: 4,250; makefile: 112; sed: 16
file content (95 lines) | stat: -rw-r--r-- 1,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          xfstt
# Required-Start:    $local_fs $network $remote_fs
# Required-Stop:     $local_fs $network $remote_fs
# Should-Start:
# Should-Stop:
# X-Start-Before:    gdm kdm xdm ldm sdm
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: xfstt sysv init script
# Description:       xfstt is a TrueType font server for X
### END INIT INFO
#
# Written by
# Stephen Carpenter <sjc@debian.org>,
# Gergely Egervary <mauzi@lin.lkg.c3.hu> and
# Guillem Jover <guillem@debian.org>.
#

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=xfstt
DAEMON=/usr/bin/$NAME
DESC="X font server"
PIDFILE=/var/run/$NAME.pid
CONFIGFILE=/etc/default/$NAME

# To change the default port and/or user modify and uncomment
portno=7101
newuser=nobody
#portarg="--port $portno"
#userarg="--user $newuser"

daemon="--daemon"

ARGS="$daemon $portarg $userarg"

test -x "$DAEMON" || exit 0

if [ -e $CONFIGFILE ]; then
	. $CONFIGFILE
else
	LISTEN_TCP=no
fi

if [ "$LISTEN_TCP" = no ]; then
	ARGS="$ARGS --notcp"
fi

. /lib/lsb/init-functions

set +e

case "$1" in
    start)
	log_daemon_msg "Starting $DESC" "$NAME"
	start-stop-daemon --start --quiet --pidfile $PIDFILE \
	                  --exec $DAEMON -- $ARGS
	log_end_msg $?
    ;;

    stop)
	log_daemon_msg "Stopping $DESC" "$NAME"
	start-stop-daemon --stop --quiet --pidfile $PIDFILE \
	                  --exec $DAEMON
	log_end_msg $?
    ;;

    force-reload|restart)
	$0 stop
	log_action_begin_msg "Reloading $DESC configuration"
	$DAEMON --sync >/dev/null
	log_action_end_msg $?
	$0 start
    ;;

  status)
	status_of_proc $DAEMON $NAME
	exit $?
	;;

    *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|force-reload|restart|status}"
	exit 1
    ;;
esac

exit 0

# vim: syn=sh: