Stefan Viljoen
2015-Jul-23 09:13 UTC
[asterisk-users] Centos 6.5 Asterisk 1.8.11.0 - starts in rc.local, but not contactible?
Hi list I'm trying to get Asterisk 1.8.11.0 to start automatically when my Centos 6.5 box boots. I've done this many times before, but for some reason, on this box and hardware (older Core i3 system, 4GB RAM) I cannot get Asterisk to be contactible after boot. E. g. in rc.local I have, as the last line --- asterisk --- as in all my other Asterisk boxes with Centos 6.5 and Asterisk 1. 8.11.0 This -does- start asterisk on boot, but you cannot connect to it using asterisk -r the error being --- [root at asterisk ~]# asterisk -r Asterisk 1.8.11.0, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster at digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?) [root at asterisk ~]# --- And I note that /var/run/asterisk.ctl does NOT exist, which is why asterisk -r does not work... I do note that there are error messages in /var/log/asterisk/messages, to whit: --- [Jul 23 10:59:31] WARNING[1863] loader.c: Error loading module 'codec_g729.so': /usr/lib/asterisk/modules/codec_g729.so: cannot enable executable stack as shared object requires: Permission denied [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Unable to connect: Adaptive Server is unavailable or does not exist (20009) [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Permission denied (13) [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Unable to connect to sqlserver --- However, if I kill -9 the "uncontactible" asterisk process and start it manually as root, everything works and runs fine, and I can connect to the running asterisk instance via asteriskr -r in a terminal. The above error messages are not emitted if asterisk is started by hand like this. Why does Asterisk have persmission problems when started out of /etc/rc.local (as root) vs. when I start it by hand while logged in as root? No config changes made to Centos 6.5 except for installing it from DVD and running a yum update. Thanks Stefan
jg
2015-Jul-23 09:40 UTC
[asterisk-users] Centos 6.5 Asterisk 1.8.11.0 - starts in rc.local, but not contactible?
> I'm trying to get Asterisk 1.8.11.0 to start automatically when my Centos > 6.5 box boots. > > I've done this many times before, but for some reason, on this box and > hardware (older Core i3 system, 4GB RAM) I cannot get Asterisk to be > contactible after boot. > > E. g. in rc.local I have, as the last line > > --- > asterisk > --- > > as in all my other Asterisk boxes with Centos 6.5 and Asterisk 1. 8.11.0 > > This -does- start asterisk on boot, but you cannot connect to it using > > asterisk -r > > the error being ... >Depending on the hardware you are using, simply calling asterisk might not be enough, as there could be dependencies on third party drivers. Depending on how asterisk was installed, one probably also has to look at various permissions. For example, asterisk -r might fail simply because you are calling it from an account with insufficient rights. It's difficult to tell given your information. Just recently, I was caught by a user inflicted problem and spent some time evaluating SIP messages... Maybe the following will help. If you look into the contrib/init.d directory (inside the src tree) you'll find the rc.redhat.asterisk script. Rename it and put it into the /etc/init.d directory and issue "chkconfig --add asterisk" as well as "chkconfig asterisk on" and your problem should be solved. You can check the current settings with "chkconfig --list asterisk". The Redhat script works nicely under CentOS. jg