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

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Jan 2 03:52:06 CST 2014


On Thu, Jan 02, 2014 at 01:31:26AM +0200, Oron Peled wrote:
> 
> On Wednesday 01 January 2014 10:23:01 Tzafrir Cohen wrote:
> > I looked into running Asterisk as non-root. But I can't find a way
> > to get systemd to generate /var/run/asterisk as a writable directory to
> > the service.
> 
> I think systemd canonical answer to this is systemd-tmpfiles(8)
> and tmpfiles.d(5).
> 
> I don't remember at which systemd version they were introduced...

Not for this case. Asterisk uses the AST_RUN_DIR (/var/run/asterisk or
whatever) for:

* asterisk.pid
* alt.asterisk.canary.tweet.tweet.tweet
* asterisk.ctl

alt.asterisk.canary.tweet.tweet.tweet is intended for communicating with
a subprocess of asterisk, and thus can reside in aprivate directory. The
pid file (if anyone else relies on it) and asterisk.ctl (the socket used
by asterisk -rx) are "published". asterisk -r is a different instance of
asterisk.

It's still a surprise for me, as generating a private run directory
seems like a relatively common case.

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com



More information about the asterisk-dev mailing list