Asterisk as non-root user

Hi to all,
i’ve installed asterisk as a non-root user and all works well except after boot i’m not able to stop or restart asterisk with non-root user…

it says me “none killed”

if i “ps aux | grep asterisk” i can see the right user and i follow “The future of telephony guide” so:
1 - compiled with ==> “./configure --prefix=$HOME/asterisk-bin –sysconfdir=$HOME/asterisk-bin --localstatedir=$HOME/asterisk-bin”

2 - ln -s /home/user/asterisk-bin/sbin/asterisk /usr/sbin/asterisk
ln -s /home/user/asterisk-bin/sbin/safe_asterisk /usr/sbin/safe_asterisk

3 - edited safe_asterisk: ASTARGS="-U user" and PATH=$PATH:/usr/sbin
4 - in asterisk.conf on the [options] section ==> Runuser => user

What am i doing wrong?

Thank you

I’ve forgot also to ask to all how i can start asterisk cli with “asterisk -rvvv” (like normal root installation) instead of “/PATH/asterisk -rvvvv”…

thank you very much

ln -s /home/user/asterisk-bin/sbin/asterisk /usr/sbin/asterisk
That should have take care of.
Alternative you could
or set an alias

[quote]i’m not able to stop or restart asterisk with non-root user…[/quote]Sorry I can’t understand you. ¿Are you stopping/restarting as root? ¿How?

No…when the server starts i can see the right non-root user as owner of process…but when i try to restart asterisk (with the same user) “/etc/init.d/asterisk restart” it says me “none killed”.

and the asterisk server does not stop and restart

Scripts in /etc/init.d are meant to be run as root. When the system starts, it will start asterisk as root, then Asterisk changes to the non-root user. You will notice the the ‘safe-asterisk’ process is still running as root. It’s job is to monitor for abnormal shutdown of the Asterisk server itself and restart a new server in the event of an abnormal shutdown.

If you really want to simply restart asterisk, you can enter the remote console with asterisk -r and issue the command:
core restart gracefully

Or you could setup and use sudo and do something like this:
sudo /etc/init.d/asterisk restart