asterisk.init fails when /var/run is tmpfs

Bug #67001 reported by Thiago Martins
10
Affects Status Importance Assigned to Milestone
asterisk (Ubuntu)
Fix Released
Medium
Paul Sladen

Bug Description

This package is merged from Debian sid, but on Debian, the dir /var/run isn't on a TMPFS. So, on Ubuntu, the init script _must_ manage this stuff.

I have added to line 71 of my asterisk.init the following function:
--- asterisk.init ---
check_privsep_dir() {
    # Create the PrivSep empty dir if necessary
    if [ ! -d /var/run/asterisk ]; then
        mkdir /var/run/asterisk
        chown asterisk:asterisk /var/run/asterisk
        chmod 0775 /var/run/asterisk
    fi
}
...
and for start, reload and restart actions, I put in the beginning of each one:
--- asterisk.init ---
  start)
        check_privsep_dir
        if status > /dev/null; then
...
 and the same for others actions.

We can remove the following line of variable `dirs' in asterisk_fix script:

dirs="
...
- /var/run/asterisk
"

That's it!
Thiago

Paul Sladen (sladen)
Changed in asterisk:
status: Unconfirmed → Needs Info
Revision history for this message
Thiago Martins (martinx) wrote :

Just a patch to asterisk.init.

Revision history for this message
Paul Sladen (sladen) wrote :

Thanks for the patch Thiago.

shawarma: are you happy with this?

Revision history for this message
Mark Drago (markdrago) wrote :

I ran in to this problem this morning. Asterisk wouldn't start at boot time. I tracked the problem down to the creation of the pidfile. I noticed a typo in the init script. The chown that changes the ownership of the pid directory (/var/run/asterisk) was setting the user to be 'askterisk' -- notice the first 'K'.

if [ ! -e `dirname $PIDFILE` ];then
       mkdir `dirname $PIDFILE`
       chown askterisk.asterisk `dirname $PIDFILE`
fi

After removing the 'K' asterisk started fine. It looks like the attached patch fixes this problem as well because it replaces this part of the script anyway. It looks like this might also fix #63713.

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 67001] Re: asterisk.init fails when /var/run is tmpfs

I'm with Mark on this one.

Indeed, removing the extra k will fix both #63713, #67092 and this bug.

Attaching a debdiff that fixes it in a few minutes.

Revision history for this message
Soren Hansen (soren) wrote :
Paul Sladen (sladen)
Changed in asterisk:
importance: Undecided → Medium
assignee: nobody → sladen
status: Needs Info → In Progress
Revision history for this message
Ante Karamatić (ivoks) wrote :

This is fixed in feisty.

Changed in asterisk:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.