[asterisk-users] Running Asterisk as root
Cesar Benjamin Garcia Martinez
cesar at codinet.com.mx
Tue May 6 12:33:54 CDT 2008
Hum. About the /var/run i do thats changes in the conf and the creation fo
/var/run into /var/lib/asterisk becouse Works :P. Yes, Ubuntu cleans al into
/var/run and that's my solution, I believe is possible touch something in
daemon for do work fine but I consider more simple make 2 folders and modify
one line
Maybe, the init.d script works well if comes from official package, I never
has installed asterisk from package, I prefer from sources.
On Mon, May 05, 2008 at 07:18:08PM -0500, Cesar Benjamin Garcia Martinez
wrote:
> Move to root:
>
> sudo -s
>
> type your passwd
>
> and as root:
>
>
> Edit the file /etc/init.d/asterisk
>
> And uncommet the two lines than sasys something like
>
> AST_USER="asterisk"
> AST_GROUP="asterisk"
>
> You need to create the user asterisk on your system.
>
> And create another symlink sh to bash:
>
> cd /bin
> rm -f sh
> ln -s bash sh
Why is that?
Debian / Ubuntu policy is that a script that is not posix sh should use
/bin/bash. Any script of Asterisk does not fit the policy and has not
bit shot^Wfixed yet?
The fix is to edit the ofending script:
#!/bin/sh -> #!/bin/bash
>
>
>
> Edit your /etc/asterisk/asterisk.conf and replace the line:
>
> astrundir => /var/run
>
> With:
>
> astrundir => /var/lib/asterisk/var/run
/var/run/asterisk
Everything under /var/run is deleted at boot with Ubuntu, so the init.d
script should recreate that directory and give it proper permissions if
it does not exist.
(or use the one from the Asterisk package)
>
> Create that folder:
>
> mkdir -p /var/lib/asterisk/var/run
/var/run/asterisk, as mentioned above. and it should be created in the
init.d script .
>
> and, chown to asterisk:asterisk the folders:
>
>
> /var/lib/asterisk/
> /usr/lib/asterisk/
No real need for /usr/lib/asterisk to be owned by Asterisk. It is
read-only. /usr is read-only, as you recall.
> /var/log/asterisk/
>
> chown -Rv asterisk:asterisk /var/lib/asterisk/
# chown -Rv asterisk:asterisk /usr/lib/asterisk/
> chown -Rv asterisk:asterisk /var/log/asterisk/
>
> that's all
>
>
>
> Btw... delete the symlink sh -> dash into /bin
NOT
>
> Start daemon
>
>
> /etc/init.d/asterisk start
--
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
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
__________ NOD32 3078 (20080506) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
More information about the asterisk-users
mailing list