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

Clean up the invirt-console-server init script with some ideas from
debathena-pyhesiodfs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-console-server/debian/invirt-console-server.init

    r1740 r1741  
    1919NAME=invirt-console-server
    2020DAEMON=/usr/bin/invirt-consolefs
    21 DAEMON_ARGS="/consolefs"
     21MOUNTPOINT="/consolefs"
     22DAEMON_ARGS="-f $MOUNTPOINT"
    2223PIDFILE=/var/run/$NAME.pid
    2324SCRIPTNAME=/etc/init.d/$NAME
     
    5657    #   1 if daemon was already running
    5758    #   2 if daemon could not be started
    58     modprobe fuse
     59   
     60    # Try to make sure fuse is setup
     61    [ -e /dev/fuse ] || modprobe fuse || return 2
     62   
     63    if cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
     64        return 1
     65    fi
     66   
    5967    gen_config
    60     daemon --running -n $NAME && return 1
    61     daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
     68   
     69    daemon -r -O daemon.info -E daemon.err -n $NAME -- $DAEMON $DAEMON_ARGS || return 2
    6270}
    6371
     
    7280    #   2 if daemon could not be stopped
    7381    #   other if a failure occurred
     82   
     83    if ! cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
     84        return 1
     85    fi
     86   
    7487    daemon --stop -n $NAME
    7588    RETVAL="$?"
     
    7790    # Many daemons don't delete their pidfiles when they exit.
    7891    rm -f $PIDFILE
    79     umount "$DAEMON_ARGS"
    80     return "$RETVAL"
    8192}
    8293
Note: See TracChangeset for help on using the changeset viewer.