~hexperides/hexperides/main

« back to all changes in this revision

Viewing changes to etc/init.d/cupsys

  • Committer: RicardoCardenes
  • Date: 2005-06-10 15:49:54 UTC
  • Revision ID: RicardoCardenes-8124e411ce351a4aa8b751fa1054a3c0e680bad5
movemos el contenido actual dentro de "trunk"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# cupsys        example file to build /etc/init.d/ scripts.
 
4
#               This file should be used to construct scripts for /etc/init.d.
 
5
#
 
6
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
 
7
#               Modified for Debian GNU/Linux
 
8
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
 
9
#
 
10
# Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
 
11
#
 
12
# This file was automatically customized by dh-make on Sun,  3 Oct 1999 20:58:02 -0500
 
13
 
 
14
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
15
DAEMON=/usr/sbin/cupsd
 
16
NAME=cupsd
 
17
DESC="Common Unix Printing System"
 
18
 
 
19
test -f $DAEMON || exit 0
 
20
 
 
21
set -e
 
22
 
 
23
# Get the timezone set.
 
24
if [ -e /etc/timezone ]; then
 
25
    TZ=`cat /etc/timezone`
 
26
    export TZ
 
27
fi
 
28
 
 
29
case "$1" in
 
30
  start)
 
31
        echo -n "Starting $DESC: $NAME"
 
32
        chown root:lpadmin /usr/share/cups/model 2>/dev/null || true
 
33
        chmod 3775 /usr/share/cups/model 2>/dev/null || true
 
34
        start-stop-daemon --start --quiet --background -m --pidfile /var/run/cups/cupsd.pid --exec $DAEMON -- -F
 
35
        echo "."
 
36
        ;;
 
37
  stop)
 
38
        echo -n "Stopping $DESC: $NAME"
 
39
        start-stop-daemon --stop --quiet --retry TERM/10 --oknodo --exec $DAEMON
 
40
        rm -f /var/run/cups/cupsd.pid
 
41
        echo "."
 
42
        ;;
 
43
  reload)
 
44
        echo -n "Reloading $DESC: $NAME"
 
45
        start-stop-daemon --stop --quiet --oknodo --signal 1 --exec $DAEMON
 
46
        echo "."
 
47
        ;;
 
48
  restart|force-reload)
 
49
        echo -n "Restarting $DESC: $NAME"
 
50
        if start-stop-daemon --stop --quiet --retry TERM/10 --oknodo --exec $DAEMON; then
 
51
                start-stop-daemon --start --quiet --background -m --pidfile /var/run/cups/cupsd.pid --exec $DAEMON -- -F
 
52
        fi
 
53
        echo "."
 
54
        ;;
 
55
  *)
 
56
        N=/etc/init.d/$NAME
 
57
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
58
        exit 1
 
59
        ;;
 
60
esac
 
61
 
 
62
exit 0