<div>Hi Friends,<br></div><div><br></div><div>I got hostname through dialplan ENV() function and set environment variable hostname in asterisk init script.</div><div><br></div><div>Thanks for everyone to resolve my problem.</div>
<div><br></div><div><br></div><br><div class="gmail_quote">On Fri, Apr 22, 2011 at 2:27 AM, Mark Deneen <span dir="ltr"><<a href="mailto:mdeneen@gmail.com">mdeneen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Thu, Apr 21, 2011 at 4:30 PM, Steve Edwards<br>
<div class="im"><<a href="http://asterisk.org" target="_blank">asterisk.org</a>@<a href="http://sedwards.com" target="_blank">sedwards.com</a>> wrote:<br>
</div><div class="im">> On Thu, 21 Apr 2011, Mark Deneen wrote:<br>
><br>
>> I use runit to manage the asterisk process, and the chpst program<br>
>> allows fine control over environment and other limits.<br>
><br>
> runit is intended to be a sysvinit (/sbin/init) replacement and is not<br>
> installed (by default) on CentOS or Ubuntu distributions.<br>
><br>
> Can chpst be used by itself? It seems a useful program except that you need<br>
> to explicitly name each environment variable you want 'ignored' and it is<br>
> part of a larger package that may have far reaching implications<br>
<br>
</div>Steve,<br>
<br>
runit is actually very unobtrusive. It is capable to replacing init,<br>
but I don't think many people actually use it that way.<br>
<a href="http://smarden.org/runit/useinit.html" target="_blank">http://smarden.org/runit/useinit.html</a> documents how to use it with<br>
init.<br>
<br>
If I wanted to clear the environment first, I'd just use env and have<br>
that call chpst. I like runit because it manages the process without<br>
the typical pid-file tracking that most init scripts use. If the<br>
process dies, for whatever reason, it is automatically restarted.<br>
stdout is captured and redirected to an optional log process which can<br>
roll logs, removing the need for logrotate and figuring out what<br>
special signal to send the process to tell it that you've truncated<br>
the log file.<br>
<br>
There is a catch, though. Your process has to run in the foreground,<br>
and runsv keeps it in the background. So, for programs which<br>
auto-detach and background themselves, you have to run them with a<br>
switch that says not to run as a daemon.<br>
<br>
It's not everyone's cup of tea, but I find it to be perfect for my<br>
needs, and a very well written utility.<br>
<font color="#888888"><br>
-M<br>
</font><div><div class="h5"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Rajnikant Vanza<br>Call : +91-9737456583<br>Software Engineer<br>-------------------------------------------------------<br>Working On Linux,C/C++,Asterisk Technology<br>
Gandhinagar - Gujarat<br>