source: trunk/server/common/patches/moira-update-server.rc.patch @ 2272

Last change on this file since 2272 was 1396, checked in by gdb, 15 years ago
Built and mildly tested moira RPM
File size: 2.8 KB
  • new file moira-update-server.init

    - +  
     1#! /bin/sh
     2# Stolen from Debathena
     3
     4### BEGIN INIT INFO
     5# Provides:          moira-update-server
     6# Required-Start:    $local_fs $remote_fs
     7# Required-Stop:     $local_fs $remote_fs
     8# Default-Start:     2 3 4 5
     9# Default-Stop:      0 1 6
     10# Short-Description: Moira update_server
     11# Description:       The moira update_server program for taking updates from
     12#                    moira
     13### END INIT INFO
     14
     15# Original Author: Evan Broder <broder@mit.edu>
     16# Modified for Fedora by Greg Brockman <gdb@mit.edu>
     17
     18# Do NOT "set -e"
     19
     20# PATH should only include /usr/* if it runs after the mountnfs.sh script
     21
     22prog=update_server
     23exec=/usr/sbin/update_server
     24config=/etc/athena/moira.conf
     25
     26# From Debathena
     27PATH=/usr/sbin:/usr/bin:/sbin:/bin
     28DESC="Moira update_server"
     29DAEMON_ARGS=""
     30SCRIPTNAME=/etc/rc.d/init.d/$NAME
     31
     32# Exit if the package is not installed
     33[ -x "$exec" ] || exit 0
     34
     35# Read configuration variable file if it is present
     36[ -r /etc/default/$prog ] && . /etc/default/$prog
     37
     38# Load the VERBOSE setting and other rcS variables
     39[ -f /etc/default/rcS ] && . /etc/default/rcS
     40
     41# Define LSB log_* functions.
     42# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
     43. /lib/lsb/init-functions
     44# End from Debathena
     45
     46# Source function library.
     47. /etc/rc.d/init.d/functions
     48
     49[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
     50
     51lockfile=/var/lock/subsys/$prog
     52
     53start() {
     54    [ -x $exec ] || exit 5
     55    [ -f $config ] || exit 6
     56    echo -n $"Starting $prog: "
     57    # if not running, start it up here, usually something like "daemon $exec"
     58    daemon $exec
     59    retval=$?
     60    echo
     61    [ $retval -eq 0 ] && touch $lockfile
     62    return $retval
     63}
     64
     65stop() {
     66    echo -n $"Stopping $prog: "
     67    # stop it here, often "killproc $prog"
     68    killproc $prog
     69    retval=$?
     70    echo
     71    [ $retval -eq 0 ] && rm -f $lockfile
     72    return $retval
     73}
     74
     75restart() {
     76    stop
     77    start
     78}
     79
     80reload() {
     81    restart
     82}
     83
     84force_reload() {
     85    restart
     86}
     87
     88rh_status() {
     89    # run checks to determine if the service is running or use generic status
     90    status $prog
     91}
     92
     93rh_status_q() {
     94    rh_status >/dev/null 2>&1
     95}
     96
     97
     98case "$1" in
     99    start)
     100        rh_status_q && exit 0
     101        $1
     102        ;;
     103    stop)
     104        rh_status_q || exit 0
     105        $1
     106        ;;
     107    restart)
     108        $1
     109        ;;
     110    reload)
     111        rh_status_q || exit 7
     112        $1
     113        ;;
     114    force-reload)
     115        force_reload
     116        ;;
     117    status)
     118        rh_status
     119        ;;
     120    condrestart|try-restart)
     121        rh_status_q || exit 0
     122        restart
     123        ;;
     124    *)
     125        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
     126        exit 2
     127esac
     128exit $?
Note: See TracBrowser for help on using the repository browser.