~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/nova-api.init

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2010-08-04 13:27:50 UTC
  • Revision ID: james.westby@ubuntu.com-20100804132750-6ps5btvek3fudl8p
Tags: 0.9.1~bzr204-0ubuntu1
First OpenStack release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
### BEGIN INIT INFO
 
3
# Provides:          nova-api
 
4
# Required-Start:    $remote_fs $syslog
 
5
# Required-Stop:     $remote_fs $syslog
 
6
# Default-Start:     2 3 4 5
 
7
# Default-Stop:      0 1 6
 
8
# Short-Description: nova-api
 
9
# Description:       nova-api
 
10
### END INIT INFO
 
11
 
 
12
 
 
13
set -e
 
14
 
 
15
DAEMON=/usr/bin/nova-api
 
16
DAEMON_ARGS="--flagfile=/etc/nova/nova-api.conf"
 
17
PIDFILE=/var/run/nova-api.pid
 
18
 
 
19
ENABLED=true
 
20
 
 
21
if test -f /etc/default/nova-api; then
 
22
  . /etc/default/nova-api
 
23
fi
 
24
 
 
25
. /lib/lsb/init-functions
 
26
 
 
27
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
 
28
 
 
29
case "$1" in
 
30
  start)
 
31
    test "$ENABLED" = "true" || exit 0
 
32
    log_daemon_msg "Starting nova api" "nova-api"
 
33
    cd /var/run
 
34
    if $DAEMON $DAEMON_ARGS start; then
 
35
      log_end_msg 0
 
36
    else
 
37
      log_end_msg 1
 
38
    fi
 
39
    ;;
 
40
  stop)
 
41
    test "$ENABLED" = "true" || exit 0
 
42
    log_daemon_msg "Stopping nova api" "nova-api"
 
43
    cd /var/run
 
44
    if $DAEMON $DAEMON_ARGS stop; then
 
45
      log_end_msg 0
 
46
    else
 
47
      log_end_msg 1
 
48
    fi
 
49
    ;;
 
50
  restart|force-reload)
 
51
    test "$ENABLED" = "true" || exit 1
 
52
    cd /var/run
 
53
    if $DAEMON $DAEMON_ARGS restart; then
 
54
      log_end_msg 0
 
55
    else
 
56
      log_end_msg 1
 
57
    fi
 
58
    ;;
 
59
  status)
 
60
    test "$ENABLED" = "true" || exit 0
 
61
    status_of_proc -p $PIDFILE $DAEMON nova-api && exit 0 || exit $?
 
62
    ;;
 
63
  *)
 
64
    log_action_msg "Usage: /etc/init.d/nova-api {start|stop|restart|force-reload|status}"
 
65
    exit 1
 
66
    ;;
 
67
esac
 
68
 
 
69
exit 0