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
signature.asc
Description: signature