source: trunk/debathena/config/linerva/debian/debathena-linerva.init @ 23906

Revision 23906, 1.9 KB checked in by broder, 15 years ago (diff)
In linerva: * Don't fail to run the initscript if /tmp/uscreens already exists.
  • Property svn:executable set to *
Line 
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          debathena-linerva
4# Required-Start:    $local_fs $remote_fs
5# Required-Stop:     $local_fs $remote_fs
6# Default-Start:     2 3 4 5
7# Default-Stop:      S 0 1 6
8# Short-Description: Linerva initialization
9# Description:       This script performs initialization needed for a
10#                    linerva-style dialup.
11### END INIT INFO
12
13# Author: Linerva Maintainers <linerva-root@mit.edu>
14
15# Do NOT "set -e"
16
17# PATH should only include /usr/* if it runs after the mountnfs.sh script
18PATH=/usr/sbin:/usr/bin:/sbin:/bin
19DESC="Linerva initialization"
20NAME=debathena-linerva
21SCRIPTNAME=/etc/init.d/$NAME
22
23# Read configuration variable file if it is present
24[ -r /etc/default/$NAME ] && . /etc/default/$NAME
25
26# Load the VERBOSE setting and other rcS variables
27[ -f /etc/default/rcS ] && . /etc/default/rcS
28
29# Define LSB log_* functions.
30# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
31. /lib/lsb/init-functions
32
33#
34# Function that starts the daemon/service
35#
36do_start()
37{
38    mkdir -p /tmp/uscreens
39    chown root:utmp /tmp/uscreens
40    chmod a=rwx,o+t /tmp/uscreens
41
42    chmod a=rwx,o+t /var/run/screen  # So that screen works without setuid.
43}
44
45case "$1" in
46  start)
47        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
48        do_start
49        case "$?" in
50                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
51                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
52        esac
53        ;;
54  stop)
55        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
56        case "$?" in
57                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
58                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
59        esac
60        ;;
61  restart|force-reload)
62        do_start
63        case "$?" in
64            0) log_end_msg 0 ;;
65            1) log_end_msg 1 ;; # Old process is still running
66            *) log_end_msg 1 ;; # Failed to start
67        esac
68        ;;
69  *)
70        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
71        exit 3
72        ;;
73esac
74
75:
Note: See TracBrowser for help on using the repository browser.