Bug#801629: asterisk: when run with systemd, asterisk no longer defaults to realtime or allows it to be configured

Jonas Smedegaard dr at jones.dk
Sun Nov 8 09:37:14 UTC 2015


Quoting Tzafrir Cohen (2015-11-08 06:35:23)
> On Mon, Oct 12, 2015 at 12:12:51PM -0700, James Bottomley wrote:
> > Package: asterisk
> > Version: 1:13.1.0~dfsg-1.1+b1
> > Severity: normal
> > 
> > Under systemv init, asterisk is spawned by /etc/init.d/asterisk, which
> > checks the /etc/default/asterisk file and spawns asterisk realtime
> > (with the -p flag) unless the default is altered to AST_REALTIME=no
> > 
> > However, with the change to systemd, the default is no longer to spawn
> > with the -p flags.  Indeed, it's no longer configurable because the
> > whole lot is hard coded in the /etc/systemd/system/asterisk.service
> > as:
> > 
> > ExecStart=/usr/sbin/asterisk -g -f -U asterisk
> > 
> > Firstly, I think we need to put this back to the default of being
> > realtime unless requested not to, and secondly, I think we need to
> > respect the configuration options of /etc/default/asterisk.
> > Unfortunately, systemd is trying to phase these files out (by ignoring
> > them):
> > 
> > http://0pointer.de/blog/projects/on-etc-sysinit.html
> > 
> > But according to the blog, there is still a way of importing shell
> > script like configuration files via the EnvironmentFile option, or by
> > spawning an actual script that reads the file.
> 
> So it's indeed possible to add:
> 
> Environment=PARAMS=[something]
> EnvironmentFile=/etc/default/asterisk
> ExecStart=/usr/sbin/asterisk $PARAMS [whatever]
> 
> However, this still won't allow supporting core dumps, as they require
> switching to a different directory. It would require an override file:
> 
> ### /etc/systemd/system/asterisk.service.d/local.conf:
> [Service]
> WorkingDirectory=[something]
> 
> So maybe just count on such an override file and just add:
> 
> Environment=EXTRA_PARAMS=
> ExecStart=/usr/sbin/asterisk $PARAMS -f -U asterisk $PARAMS

In several recent discussions about getting rid or the antipattern of 
START=yes in /etc/default/$pkg I seem to recall systemd followers to 
strongly advise against use of environment variables in general.  I 
might have misunderstood their point, but I suggest to ask them for 
advice here on what they'd consider a good pattern to use.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20151108/64b40479/attachment.sig>


More information about the Pkg-voip-maintainers mailing list