Changeset 1743


Ignore:
Timestamp:
Nov 22, 2008, 5:36:27 AM (15 years ago)
Author:
broder
Message:

Steal debathena-pyhesiodfs's ideas for invirt-remote-server, too

Location:
trunk/packages/invirt-remote-server/debian
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-remote-server/debian/changelog

    r1728 r1743  
     1invirt-remote-server (0.1.4) unstable; urgency=low
     2
     3  * Steal some init script ideas from debathena-pyhesiodfs
     4
     5 -- Evan Broder <broder@mit.edu>  Sat, 22 Nov 2008 05:31:49 -0500
     6
    17invirt-remote-server (0.1.3) unstable; urgency=low
    28
  • trunk/packages/invirt-remote-server/debian/invirt-remote-server.init

    r1740 r1743  
    1616DESC="the Invirt remctl configuration filesystem"
    1717DAEMON=/usr/sbin/invirt-remconffs
    18 DAEMON_ARGS="/etc/remctl/remconffs"
     18MOUNTPOINT="/etc/remctl/remconffs"
     19DAEMON_ARGS="-f $MOUNTPOINT"
    1920PIDFILE=/var/run/$NAME.pid
    2021SCRIPTNAME=/etc/init.d/$NAME
     
    2728. /lib/init/std-init.sh
    2829
     30#
     31# Function that starts the daemon/service
     32#
    2933do_start()
    3034{
     
    3337    #   1 if daemon was already running
    3438    #   2 if daemon could not be started
    35     gen_files
    36     modprobe fuse
    37     daemon --running -n $NAME && return 1
    38     daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
     39   
     40    # Try to make sure fuse is setup
     41    [ -e /dev/fuse ] || modprobe fuse || return 2
     42   
     43    if cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
     44        return 1
     45    fi
     46   
     47    gen_config
     48   
     49    daemon -r -O daemon.info -E daemon.err -n $NAME -- $DAEMON $DAEMON_ARGS || return 2
    3950}
    4051
     52#
     53# Function that stops the daemon/service
     54#
    4155do_stop()
    4256{
     
    4660    #   2 if daemon could not be stopped
    4761    #   other if a failure occurred
     62   
     63    if ! cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
     64        return 1
     65    fi
     66   
    4867    daemon --stop -n $NAME
    4968    RETVAL="$?"
     
    5170    # Many daemons don't delete their pidfiles when they exit.
    5271    rm -f $PIDFILE
    53     umount "$DAEMON_ARGS"
    54     return "$RETVAL"
     72}
     73
     74do_reload()
     75{
     76    gen_config
    5577}
    5678
Note: See TracChangeset for help on using the changeset viewer.