[asterisk-dev] [Code Review] 3062: a systemd service

Tzafrir Cohen reviewboard at asterisk.org
Mon Feb 10 11:16:13 CST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3062/
-----------------------------------------------------------

(Updated Feb. 10, 2014, 5:16 p.m.)


Review request for Asterisk Developers.


Changes
-------

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.


Repository: Asterisk


Description
-------

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.


Diffs (updated)
-----

  /trunk/contrib/scripts/live_ast 407855 
  /trunk/contrib/scripts/asterisk_cleanup PRE-CREATION 
  /trunk/contrib/asterisk.service PRE-CREATION 
  /trunk/Makefile 407855 

Diff: https://reviewboard.asterisk.org/r/3062/diff/


Testing
-------


Thanks,

Tzafrir Cohen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140210/a6aecc79/attachment.html>


More information about the asterisk-dev mailing list