~davewalker/ubuntu/maverick/asterisk/lp_705014

« back to all changes in this revision

Viewing changes to debian/backports/asterisk.init.hardy

  • Committer: Bazaar Package Importer
  • Author(s): Jean-Michel Dault
  • Date: 2010-02-16 14:08:54 UTC
  • mfrom: (1.2.5 upstream) (8.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100216140854-rb2godspb9lduazl
Tags: 1:1.6.2.2-1ubuntu1
* Merge from Debian: security update
  * Changes:
  - debian/control: Change Maintainer
  - debian/control: Removed Uploaders field.
  - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
  - debian/asterisk.init : chown /dev/dahdi
  - debian/backports/hardy : add file
  - debian/backports/asterisk.init.hardy : add file

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
### BEGIN INIT INFO
14
14
# Provides:          asterisk
15
 
# Required-Start:    $local_fs zaptel
16
 
# Required-Stop:     $local_fs
17
 
# Should-Start:      
18
 
# Should-Stop:       
 
15
# Required-Start:    $remote_fs
 
16
# Required-Stop:     $remote_fs
 
17
# Should-Start:      dahdi mysql postgresql
 
18
# Should-Stop:       mysql postgresql
19
19
# Default-Start:     2 3 4 5
20
20
# Default-Stop:      0 1 6
21
21
# Short-Description: Asterisk PBX
27
27
USER=$NAME
28
28
GROUP=$USER
29
29
DAEMON=/usr/sbin/$NAME
 
30
CANARY=/usr/sbin/astcanary
30
31
DESC="Asterisk PBX"
31
32
PIDFILE="/var/run/asterisk/asterisk.pid"
32
33
ASTSAFE_PIDFILE="/var/run/asterisk/asterisk_safe.pid"
99
100
 
100
101
#Make the device belong to the right user
101
102
if [ -e /dev/dahdi ];then
102
 
        chown $USER:$GROUP /dev/dahdi/*
 
103
       chown $USER:$GROUP /dev/dahdi/*
103
104
fi
104
105
 
105
106
set -e
132
133
        # if $HOME is set, asterisk -rx writes a .asterisk_history there
133
134
        (
134
135
                unset HOME
135
 
 
136
136
                $DAEMON -rx "$1"
137
137
        )
138
138
}
163
163
                fi
164
164
                start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
165
165
                        $CHDIR_PARM \
166
 
                        --exec $REALDAEMON -- $PARAMS
 
166
                        --exec $REALDAEMON -- $PARAMS > /dev/null
167
167
        else
168
168
                start-stop-daemon --start --group $GROUP \
169
169
                        --background --make-pidfile \
180
180
        # this may hang in some cases. Specifically, when the asterisk
181
181
        # processes is stopped. No bother to worry about cleanup: 
182
182
        # it will either fail or die when asterisk dies.
183
 
        ( asterisk_rx 'stop now' > /dev/null 2>&1 & ) &
 
183
        ( asterisk_rx 'core stop now' > /dev/null 2>&1 & ) &
184
184
        if [ "$RUNASTSAFE" = "yes" ];then
185
185
                start-stop-daemon --stop --quiet --oknodo \
186
186
                                  --pidfile $ASTSAFE_PIDFILE
189
189
        # just making sure it's really, really dead. 
190
190
        # KILL is necessary just in case there's an asterisk -r in the background
191
191
        start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $DAEMON
 
192
        start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $CANARY
192
193
        echo "."
193
194
        ;;
194
195
  reload)
203
204
        asterisk_rx 'dialplan reload'
204
205
        ;;
205
206
  restart-convenient)
206
 
        asterisk_rx 'restart when convenient'
 
207
        asterisk_rx 'core restart when convenient'
207
208
        ;;
208
209
  restart|force-reload)
209
210
        $0 stop