[23563] | 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 |
---|
| 18 | PATH=/usr/sbin:/usr/bin:/sbin:/bin |
---|
| 19 | DESC="Linerva initialization" |
---|
| 20 | NAME=debathena-linerva |
---|
| 21 | SCRIPTNAME=/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 | # |
---|
| 36 | do_start() |
---|
| 37 | { |
---|
[23906] | 38 | mkdir -p /tmp/uscreens |
---|
[23563] | 39 | chown root:utmp /tmp/uscreens |
---|
| 40 | chmod a=rwx,o+t /tmp/uscreens |
---|
[23571] | 41 | |
---|
| 42 | chmod a=rwx,o+t /var/run/screen # So that screen works without setuid. |
---|
[23563] | 43 | } |
---|
| 44 | |
---|
| 45 | case "$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 |
---|
[23569] | 68 | ;; |
---|
[23563] | 69 | *) |
---|
| 70 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 |
---|
| 71 | exit 3 |
---|
| 72 | ;; |
---|
| 73 | esac |
---|
| 74 | |
---|
| 75 | : |
---|