[asterisk-users] [asterisk-user] Can't get hostname on asterisk dialplan by ENV()
Mark Deneen
mdeneen at gmail.com
Thu Apr 21 15:57:33 CDT 2011
On Thu, Apr 21, 2011 at 4:30 PM, Steve Edwards
<asterisk.org at sedwards.com> wrote:
> On Thu, 21 Apr 2011, Mark Deneen wrote:
>
>> I use runit to manage the asterisk process, and the chpst program
>> allows fine control over environment and other limits.
>
> runit is intended to be a sysvinit (/sbin/init) replacement and is not
> installed (by default) on CentOS or Ubuntu distributions.
>
> Can chpst be used by itself? It seems a useful program except that you need
> to explicitly name each environment variable you want 'ignored' and it is
> part of a larger package that may have far reaching implications
Steve,
runit is actually very unobtrusive. It is capable to replacing init,
but I don't think many people actually use it that way.
http://smarden.org/runit/useinit.html documents how to use it with
init.
If I wanted to clear the environment first, I'd just use env and have
that call chpst. I like runit because it manages the process without
the typical pid-file tracking that most init scripts use. If the
process dies, for whatever reason, it is automatically restarted.
stdout is captured and redirected to an optional log process which can
roll logs, removing the need for logrotate and figuring out what
special signal to send the process to tell it that you've truncated
the log file.
There is a catch, though. Your process has to run in the foreground,
and runsv keeps it in the background. So, for programs which
auto-detach and background themselves, you have to run them with a
switch that says not to run as a daemon.
It's not everyone's cup of tea, but I find it to be perfect for my
needs, and a very well written utility.
-M
More information about the asterisk-users
mailing list