Bug#333351: asterisk: Log files owned by root

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Oct 11 20:19:36 UTC 2005


On Tue, Oct 11, 2005 at 03:49:15PM +0200, Rolf Leggewie wrote:
> Package: asterisk
> Version: 1:1.0.7.dfsg.1-2
> Severity: important
> 
> Dear VoIP Team,
> 
> thank you for packaging asterisk.
> 
> Maybe I made a mistake but today I tried to install asterisk on one of 
> my computers.  Asterisk failed to start so I enabled verbose debugging 
> in /etc/default/asterisk.  

I wrote a small patch that adds an extra command-line switch to asterisk:
'asterisk -D' will daemonize even when -v and/or -d is used. Would such
a patch be useful for you?

> The reason for the failure seems to be that 
> asterisk cannot open /var/log/asterisk/messages for writing since it is 
> owned by root as are event_log and queue_log.  I cannot remember 
> changing those files so I assume they were created by the package with 
> that ownership.  Maybe you want to take a look.

You accidentally ran asterisk directly and not through the init.d
script., and failed to give it the option '-U asterisk' .  Thus it ran
as root (something that the init.d script prevents).

To fix the current situation:

  chown -R asterisk.asterisk /var/log/asterisk /var/run/asterisk

Anyway, in order to prevent such a situation we have added the option
"debug" to the init.d script in our package. So you'd never have to run
a plain 'asterisk -c' just to get a console to debug startup, and you
could use /etc/init.d/asterisk debug' . Longer, but safer.

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



More information about the Pkg-voip-maintainers mailing list