~ubuntu-branches/ubuntu/vivid/rpcbind/vivid

« back to all changes in this revision

Viewing changes to debian/init.d

  • Committer: Steve Langasek
  • Date: 2012-01-03 07:35:59 UTC
  • mfrom: (5.1.3 wheezy)
  • Revision ID: steve.langasek@canonical.com-20120103073559-8x1ymw7442ljn7ps
Merge version 0.2.0-7 from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
. /lib/lsb/init-functions
22
22
 
23
23
OPTIONS="-w"
24
 
STATEDIR=/var/run/rpcbind
 
24
STATEDIR=/run/rpcbind
 
25
PIDFILE=/run/rpcbind.pid
 
26
 
25
27
if [ -f /etc/default/rpcbind ]
26
28
then
27
29
    . /etc/default/rpcbind
40
42
        log_end_msg 1
41
43
        exit 1
42
44
    fi
 
45
    if [ ! -f $STATEDIR/rpcbind.xdr ]
 
46
    then
 
47
        touch $STATEDIR/rpcbind.xdr
 
48
    fi
 
49
    if [ ! -f $STATEDIR/portmap.xdr ]
 
50
    then
 
51
        touch $STATEDIR/portmap.xdr
 
52
    fi
43
53
    log_begin_msg "Starting rpcbind daemon..."
44
54
    pid=$( pidofproc /sbin/rpcbind )
45
55
    if [ -n "$pid" ]
49
59
        exit 0
50
60
    fi
51
61
    start-stop-daemon --start --quiet --oknodo --exec /sbin/rpcbind -- "$@"
 
62
    pid=$( pidofproc /sbin/rpcbind )
 
63
    echo -n "$pid" >"$PIDFILE"
 
64
    # /run/sendsigs.omit.d is created by /etc/init.d/mountkernfs.sh
 
65
    ln -sf "$PIDFILE" /run/sendsigs.omit.d/rpcbind
52
66
    log_end_msg $?
53
 
    mkdir -p /lib/init/rw/sendsigs.omit.d
54
 
    pid=$( pidofproc /sbin/rpcbind )
55
 
    echo -n "$pid" > /lib/init/rw/sendsigs.omit.d/rpcbind
56
67
 
57
68
}
58
69
 
60
71
{
61
72
    log_begin_msg "Stopping rpcbind daemon..."
62
73
    start-stop-daemon --stop --quiet --oknodo --exec /sbin/rpcbind
 
74
    rm -f "$PIDFILE"
63
75
    log_end_msg $?
64
76
}
65
77