[Home]

Summary:ASTERISK-13809: [patch] Fix runlevels in Debian rc files
Reporter:pkempgen (pkempgen)Labels:
Date Opened:2009-03-23 21:17:12Date Closed:2009-08-24 21:43:31
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) debian_updaterc.diff
Description:This is about fixing the runlevels on Debian.

Here's my lovingly handcrafted diff of the Makefile:
-------------------
                elif [ -f /etc/debian_version ]; then \
                        $(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
-                        if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
+                        if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk defaults 50 15; fi; \
                elif [ -f /etc/gentoo-release ]; then \
-------------------

****** ADDITIONAL INFORMATION ******

http://lists.digium.com/pipermail/asterisk-users/2008-October/220850.html :
---cut---
This was an old thread
http://lists.digium.com/pipermail/asterisk-users/2007-November/200539.html
so I'm starting a new one.

Tzafrir Cohen wrote:
> On Thu, Nov 15, 2007 at 06:47:04PM +0100, Philipp Kempgen wrote:
>> On Debian the Asterisk Makefile does
>>
>> /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .;
>>
>> which results in a /etc/rc2.d/S10asterisk being written.
>>
>> I think S10 is too early.

Tilghman Lesher changed it to
update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .
in 1.4 rev. 89302 (1.6.0, 1.6.1 and trunk rev. 89304)
as per my suggestion (thanks!) but I missed a part of the problem:

> And it would also be simpler to use:
>
>   update-rc.d asterisk defaults 10 91
>
> Or, for better numbers:
>
>   update-rc.d asterisk defaults 30 15
>
> Note that on Debian the K scripts are in runlevels 0, 1 and 6.

Tzafrir is right. No K scripts in 0,1,6 => Asterisk is not being
stopped on shutdown at all, thus unloading Zaptel fails
("Unloading zaptel hardware drivers:ERROR: Module zaptel is in use").

The correct thing to do (I guess) would be:
/usr/sbin/update-rc.d asterisk defaults 50 15
---cut---

I guess 1.6.x and trunk are affected as well.
Comments:By: pkempgen (pkempgen) 2009-03-23 21:20:39

Erm the lovingly handcrafted unified diff doesn't look
*that* pretty here on the bug tracker.  :-)
And I should have added that the hunk is in the
make config target.

By: Tzafrir Cohen (tzafrir) 2009-06-16 16:11:33

Reformatted as an actual patch. Not actually tested.

By: Digium Subversion (svnbot) 2009-08-24 21:40:58

Repository: asterisk
Revision: 213899

U   branches/1.4/Makefile

------------------------------------------------------------------------
r213899 | tilghman | 2009-08-24 21:40:58 -0500 (Mon, 24 Aug 2009) | 4 lines

Use the default runlevels for Debian derivatives, instead of making up our own.
(closes issue ASTERISK-13809)
Reported by: pkempgen

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=213899

By: Digium Subversion (svnbot) 2009-08-24 21:41:53

Repository: asterisk
Revision: 213900

_U  trunk/
U   trunk/Makefile

------------------------------------------------------------------------
r213900 | tilghman | 2009-08-24 21:41:53 -0500 (Mon, 24 Aug 2009) | 11 lines

Merged revisions 213899 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r213899 | tilghman | 2009-08-24 21:40:22 -0500 (Mon, 24 Aug 2009) | 4 lines
 
 Use the default runlevels for Debian derivatives, instead of making up our own.
 (closes issue ASTERISK-13809)
  Reported by: pkempgen
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=213900

By: Digium Subversion (svnbot) 2009-08-24 21:43:09

Repository: asterisk
Revision: 213901

_U  branches/1.6.0/
U   branches/1.6.0/Makefile

------------------------------------------------------------------------
r213901 | tilghman | 2009-08-24 21:43:08 -0500 (Mon, 24 Aug 2009) | 18 lines

Merged revisions 213900 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r213900 | tilghman | 2009-08-24 21:41:17 -0500 (Mon, 24 Aug 2009) | 11 lines
 
 Merged revisions 213899 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r213899 | tilghman | 2009-08-24 21:40:22 -0500 (Mon, 24 Aug 2009) | 4 lines
   
   Use the default runlevels for Debian derivatives, instead of making up our own.
   (closes issue ASTERISK-13809)
    Reported by: pkempgen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=213901

By: Digium Subversion (svnbot) 2009-08-24 21:43:17

Repository: asterisk
Revision: 213902

_U  branches/1.6.1/
U   branches/1.6.1/Makefile

------------------------------------------------------------------------
r213902 | tilghman | 2009-08-24 21:43:17 -0500 (Mon, 24 Aug 2009) | 18 lines

Merged revisions 213900 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r213900 | tilghman | 2009-08-24 21:41:17 -0500 (Mon, 24 Aug 2009) | 11 lines
 
 Merged revisions 213899 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r213899 | tilghman | 2009-08-24 21:40:22 -0500 (Mon, 24 Aug 2009) | 4 lines
   
   Use the default runlevels for Debian derivatives, instead of making up our own.
   (closes issue ASTERISK-13809)
    Reported by: pkempgen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=213902

By: Digium Subversion (svnbot) 2009-08-24 21:43:30

Repository: asterisk
Revision: 213903

_U  branches/1.6.2/
U   branches/1.6.2/Makefile

------------------------------------------------------------------------
r213903 | tilghman | 2009-08-24 21:43:30 -0500 (Mon, 24 Aug 2009) | 18 lines

Merged revisions 213900 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r213900 | tilghman | 2009-08-24 21:41:17 -0500 (Mon, 24 Aug 2009) | 11 lines
 
 Merged revisions 213899 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r213899 | tilghman | 2009-08-24 21:40:22 -0500 (Mon, 24 Aug 2009) | 4 lines
   
   Use the default runlevels for Debian derivatives, instead of making up our own.
   (closes issue ASTERISK-13809)
    Reported by: pkempgen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=213903