Review Board 1.7.16


a systemd service

Review Request #3062 - Created Dec. 23, 2013 and updated

Tzafrir Cohen
/trunk
Reviewers
asterisk-dev
Asterisk
Installs a systemd service file for Asterisk.

Systeemd is the new "one daemon to rule them all" for Linux: http://www.freedesktop.org/wiki/Software/systemd/
On systems without systemd this should be just a harmless (though maybe annoying) text file.

This is aimed at replacing safe_asterisk with a more reliable main loop. It almost does that. Is still fails to handle failures, as it seems that systemd's ExecPostStop command does not get the exist status of the stopped command.

 
Total:
9
Open:
4
Resolved:
5
Dropped:
0
Status:
From:
Description From Last Updated Status
Looking at how safe_asterisk spawns Asterisk, I'm not sure specifying an explicit run user is appropriate here. There's no guarantee ... Matt Jordan Dec. 31, 2013, 7:41 p.m. Open
I think this patch should consider providing a basic stop post script that does what safe_asterisk performs with respect to ... Matt Jordan Dec. 31, 2013, 7:41 p.m. Open
If -n is not used, the journal considers the line as [181B blob data] (at least with the version of ... Tzafrir Cohen Feb. 10, 2014, 12:56 p.m. Open
Even setting this to 1 seems pointless (the default is 100ms). If you want to test it, you can use ... Tzafrir Cohen Feb. 10, 2014, 1:32 p.m. Open
Review request changed
Updated (Feb. 10, 2014, 11:16 a.m.)
I realised that the main reason I needed a wrapper script was for running a different instance of Asterisk with live_ast. This requires editing a number of pathes, which is sub-optimal.

I ended up having live_ast provide its own systemd unit under live/asterisk-live.service . The user will need to copy that file to /etc/systemd/system if the user wants to add asterisk-live as a separate service (stop asterisk, start asterisk-live).

I set the working directory to /var/lib/asterisk . As the working directory is writable, there is no reason to actively disable core files and thus adding -g to the command line looks like a good idea.

I also added example cleanup script that should do the same job as the cleanup code in safe_asterisk (though it does not report failures). I decided that /var/spool/asterisk/cores is a good storage for core files. This script is an example only and is not installed by default.
Posted (Feb. 10, 2014, 12:56 p.m.)

   

  
/trunk/contrib/asterisk.service (Diff revision 3)
 
 
If -n is not used, the journal considers the line as [181B blob data] (at least with the version of systemd in Debian Wheezy).

Should we default to -n? Any better alteernative?
Posted (Feb. 10, 2014, 1:32 p.m.)

   

  
/trunk/contrib/asterisk.service (Diff revision 3)
 
 
Even setting this to 1 seems pointless (the default is 100ms). If you want to test it, you can use the following wrapper to asterisk:

#!/bin/sh

# if you put here 'sleep 1' instead of 'sleep 2', systemd will only restart
# asterisk twice or so and then give up.
(sleep 2; killall -9 asterisk) &

exec /usr/sbin/asterisk "$@"

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.