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:[email protected]
+972-50-7952406           mailto:[email protected]
http://www.xorcom.com  iax:[email protected]/tzafrir

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to