[asterisk-users] Asterisk 1.6 SSH Console Colors Debian Lenny
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Sun Jan 23 11:32:50 CST 2011
On Thu, Jan 20, 2011 at 06:22:23PM +0000, A J Stiles wrote:
> On Thursday 20 Jan 2011, JR Richardson wrote:
> > Hi All,
> >
> > I'm running * 1.6.0.28 on Debian Lenny. The init'd script starts the
> > asterisk daemon not the safe_asterisk daemon so when asterisk is
> > running and I ssh tot he server then 'asterisk -vr' to attach to the
> > asterisk console there are no colors. If I use the safe_asterisk
> > script to start asterisk, the colors are fine when I attach through
> > SSH.
>
> I'm running Debian but have been running Asterisk since before there was a
> proper Debian package, and so I ended up writing my own init.d script. See
> attached. No guarantees or anything :)
A number of things I did not like about it:
1. I don't trust safe_asterisk to properly handle being run twice and
such.
2. Likewise with daemonization. safe_asterisk is still at the console.
3. You run asterisk as root. And use /var/run/asterisk.pid . Please use
a non-root user and /var/run/asterisk/asterisk.pid .
4. On 'restart' you do nothing if the process was not running. That's
not the standard semantics.
5. Even if a pid file exists, it does not mean that the process listed
in it is your process.
In short:
A. Don't re-invent start-stop-daemon.
B. Let's just move to upstart/systemd so there won't be a need for this
stupid guardian "safe" asterisk.
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
More information about the asterisk-users
mailing list