~jamesodhunt/ubuntu/precise/upstart/precise-proposed

« back to all changes in this revision

Viewing changes to debian/upstart-job

  • Committer: Steve Langasek
  • Date: 2012-04-16 15:15:25 UTC
  • mfrom: (1387.1.1 ubuntu-upstart)
  • Revision ID: steve.langasek@canonical.com-20120416151525-vjibaobu6ka2lw24
Tags: 1.5-0ubuntu5
Merge fix for bug #974147

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"
38
38
$ECHO "utility, e.g. service $INITSCRIPT $COMMAND"
39
39
 
 
40
initctl show-config -e "$JOB"|grep -q '^  start on' || DISABLED=1
 
41
 
40
42
case $COMMAND in
41
43
status)
42
44
    $ECHO
55
57
        exit 0
56
58
    elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then
57
59
        exit 0
 
60
    elif [ -n "$DISABLED" ] && [ "$COMMAND" = "start" ]; then
 
61
        exit 0
58
62
    fi
59
63
    $COMMAND "$JOB"
60
64
    ;;
69
73
    if [ -n "$RUNNING" ] ; then
70
74
        stop "$JOB"
71
75
    fi
 
76
    # If the job is disabled and is not currently running, the job is
 
77
    # not restarted. However, if the job is disabled but has been forced into the
 
78
    # running state, we *do* stop and restart it since this is expected behaviour
 
79
    # for the admin who forced the start.
 
80
    if [ -n "$DISABLED" ] && [ -z "$RUNNING" ]; then
 
81
        exit 0
 
82
    fi
72
83
    start "$JOB"
73
84
    ;;
74
85
reload|force-reload)