Dan Cropp
2017-Mar-14 17:09 UTC
[asterisk-users] Having problem getting Asterisk to work on CentOS 7
Thank you Tzafrir. I had been using different users in earlier attempts to make this work. Decided to try everything where root is the only user, simply to verify it's working. For problem 2, where asterisk is writing to the log but doesn't seem to receive the SIP packets even though tcpdump indicates they are making it to the box on 5060, I am starting asterisk while logged in as root. /usr/sbin/asterisk -vvvvvvvvdddddddc For problem 1, where it seems to be stuck when running as a service, I simply reboot the machine. Then I log it as root and notice it's not writing to the log. When running it as a service (after restart). Here is what the output from strace -p $PID_OF_ASTERISK [root at localhost ~]# strace -p 1470 Process 1470 attached wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2505 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2505, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, 0x7ffd2cbd4490, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 stat("/bin/pkill", {st_mode=S_IFREG|0755, st_size=28336, ...}) = 0 stat("/bin/pkill", {st_mode=S_IFREG|0755, st_size=28336, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/pkill", X_OK) = 0 stat("/bin/pkill", {st_mode=S_IFREG|0755, st_size=28336, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/pkill", R_OK) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2509 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2509 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2509, si_status=1, si_utime=0, si_stime=0} --- wait4(-1, 0x7ffd2cbd4490, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=132, ...}) = 0 chdir("/tmp") = 0 stat("/bin/stty", {st_mode=S_IFREG|0755, st_size=70264, ...}) = 0 stat("/bin/stty", {st_mode=S_IFREG|0755, st_size=70264, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/stty", X_OK) = 0 stat("/bin/stty", {st_mode=S_IFREG|0755, st_size=70264, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/stty", R_OK) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2510 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2510 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2510, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, 0x7ffd2cbd3d10, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 stat("/bin/nice", {st_mode=S_IFREG|0755, st_size=33096, ...}) = 0 stat("/bin/nice", {st_mode=S_IFREG|0755, st_size=33096, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/nice", X_OK) = 0 stat("/bin/nice", {st_mode=S_IFREG|0755, st_size=33096, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/nice", R_OK) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2511 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2511 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2511, si_status=1, si_utime=3, si_stime=0} --- wait4(-1, 0x7ffd2cbd3e10, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 open("/dev/tty9", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 fcntl(1, F_GETFD) = 0 fcntl(1, F_DUPFD, 10) = 10 fcntl(1, F_GETFD) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 dup2(3, 1) = 1 close(3) = 0 write(1, "Asterisk ended with exit status "..., 34) = 34 dup2(10, 1) = 1 fcntl(10, F_GETFD) = 0x1 (flags FD_CLOEXEC) close(10) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 open("/dev/tty9", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 fcntl(1, F_GETFD) = 0 fcntl(1, F_DUPFD, 10) = 10 fcntl(1, F_GETFD) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 dup2(3, 1) = 1 close(3) = 0 write(1, "Asterisk died with code 1.\n", 27) = 27 dup2(10, 1) = 1 fcntl(10, F_GETFD) = 0x1 (flags FD_CLOEXEC) close(10) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 pipe([3, 4]) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2512 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGCHLD, {0x441200, [], SA_RESTORER|SA_RESTART, 0x7f1a0245b250}, {0x441200, [], SA_RESTORER|SA_RESTART, 0x7f1a0245b250}, 8) = 0 close(4) = 0 read(3, "2511\n", 128) = 5 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2512, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 2512 wait4(-1, 0x7ffd2cbd39d0, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 5 read(3, "", 128) = 0 close(3) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 pipe([3, 4]) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2513 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGCHLD, {0x441200, [], SA_RESTORER|SA_RESTART, 0x7f1a0245b250}, {0x441200, [], SA_RESTORER|SA_RESTART, 0x7f1a0245b250}, 8) = 0 close(4) = 0 read(3, "2017-03-14T12:01:01-0500\n", 128) = 25 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2513, si_status=0, si_utime=0, si_stime=0} --- wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 2513 wait4(-1, 0x7ffd2cbd3b10, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn() = 25 read(3, "", 128) = 0 close(3) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 stat("/tmp/core.2511", 0x7ffd2cbd4370) = -1 ENOENT (No such file or directory) rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 stat("/tmp/core", 0x7ffd2cbd4260) = -1 ENOENT (No such file or directory) rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 open("/dev/tty9", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 fcntl(1, F_GETFD) = 0 fcntl(1, F_DUPFD, 10) = 10 fcntl(1, F_GETFD) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 dup2(3, 1) = 1 close(3) = 0 write(1, "Automatically restarting Asteris"..., 35) = 35 dup2(10, 1) = 1 fcntl(10, F_GETFD) = 0x1 (flags FD_CLOEXEC) close(10) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 stat("/bin/sleep", {st_mode=S_IFREG|0755, st_size=33112, ...}) = 0 stat("/bin/sleep", {st_mode=S_IFREG|0755, st_size=33112, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/sleep", X_OK) = 0 stat("/bin/sleep", {st_mode=S_IFREG|0755, st_size=33112, ...}) = 0 geteuid() = 0 getegid() = 0 getuid() = 0 getgid() = 0 access("/bin/sleep", R_OK) = 0 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [INT CHLD], 8) = 0 rt_sigprocmask(SIG_SETMASK, [INT CHLD], NULL, 8) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f1a02e24a10) = 2514 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 rt_sigaction(SIGINT, {SIG_IGN, [], SA_RESTORER, 0x7f1a0245b250}, {0x43e670, [], SA_RESTORER, 0x7f1a0245b250}, 8) = 0 wait4(-1, Have a great day! Dan -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tzafrir Cohen Sent: Tuesday, March 14, 2017 11:54 AM To: asterisk-users at lists.digium.com Subject: Re: [asterisk-users] Having problem getting Asterisk to work on CentOS 7 On Tue, Mar 14, 2017 at 04:45:38PM +0000, Dan Cropp wrote:> After that, I modify the asterisk conf files for a couple pjsip endpoints and turn on debugging and verbosity. Copying settings from another box which is working. > > I am seeing two different issues.... > > First, when I restart the box, the asterisk process is present. However, it's not writing anything to the log files so it seems to be stuck. Any idea why running Asterisk as a service after the make config would not seem to fully start up?You mentioned starting asterisk manually. Do you do that with the proper permissions (assuming you do run Asterisk as a non-root user, as you should). Any chance asterisk does not have write permissions to the log files? Failing that, try strace. strace -p $PID_OF_ASTERISk Maybe also add -f and / or -o if there's too much output. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Tzafrir Cohen
2017-Mar-14 18:18 UTC
[asterisk-users] Having problem getting Asterisk to work on CentOS 7
On Tue, Mar 14, 2017 at 05:09:17PM +0000, Dan Cropp wrote:> Thank you Tzafrir. > > I had been using different users in earlier attempts to make this work. Decided to try everything where root is the only user, simply to verify it's working. > > For problem 2, where asterisk is writing to the log but doesn't seem to receive the SIP packets even though tcpdump indicates they are making it to the box on 5060, I am starting asterisk while logged in as root. > /usr/sbin/asterisk -vvvvvvvvdddddddc > > > For problem 1, where it seems to be stuck when running as a service, I simply reboot the machine. Then I log it as root and notice it's not writing to the log. > > When running it as a service (after restart). Here is what the output from strace -p $PID_OF_ASTERISK > > [root at localhost ~]# strace -p 1470pkill? nice? That is not asterisk. Are you sure you got the right process? Maybe you got safe_asterisk instead? If it is safe_asterisk: 1. That script is pointless now that you have systemd. Replace it with a simple systemd unit (hint: Restart=on-failure gets you most of the way there). Isn't there one already included with Asterisk by now? 2. Use the option -f of strace to see the exact error message. What is error status 34 of asterisk? ERANGE? -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com
Eric Wieling
2017-Mar-14 18:33 UTC
[asterisk-users] Having problem getting Asterisk to work on CentOS 7
This is what I hacked up for my CentOS 7 Asterisk server. It does NOT act like safe_asterisk. [Unit] Description=Asterisk PBX and telephony daemon Documentation=man:asterisk(8) After=network-online.target multi-user.target [Service] Type=simple User=root Group=root Environment=HOME=/var/lib/asterisk WorkingDirectory=/var/lib/asterisk ExecStart=/usr/sbin/asterisk -f -C /etc/asterisk/asterisk.conf ExecStop=/usr/sbin/asterisk -rx 'core stop now' ExecReload=/usr/bin/asterisk -rx 'core reload' [Install] WantedBy=multi-user.target On Tue, Mar 14, 2017 at 2:18 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:> On Tue, Mar 14, 2017 at 05:09:17PM +0000, Dan Cropp wrote: > > Thank you Tzafrir. > > > > I had been using different users in earlier attempts to make this work. > Decided to try everything where root is the only user, simply to verify > it's working. > > > > For problem 2, where asterisk is writing to the log but doesn't seem to > receive the SIP packets even though tcpdump indicates they are making it to > the box on 5060, I am starting asterisk while logged in as root. > > /usr/sbin/asterisk -vvvvvvvvdddddddc > > > > > > For problem 1, where it seems to be stuck when running as a service, I > simply reboot the machine. Then I log it as root and notice it's not > writing to the log. > > > > When running it as a service (after restart). Here is what the output > from strace -p $PID_OF_ASTERISK > > > > [root at localhost ~]# strace -p 1470 > > pkill? nice? That is not asterisk. Are you sure you got the right > process? Maybe you got safe_asterisk instead? If it is safe_asterisk: > > 1. That script is pointless now that you have systemd. Replace it with a > simple systemd unit (hint: Restart=on-failure gets you most of the way > there). > > Isn't there one already included with Asterisk by now? > > 2. Use the option -f of strace to see the exact error message. What is > error status 34 of asterisk? ERANGE? > > -- > Tzafrir Cohen > icq#16849755 jabber:tzafrir.cohen at xorcom.com > +972-50-7952406 mailto:tzafrir.cohen at xorcom.com > http://www.xorcom.com > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk. > org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- GMail: Making MS Outlook look good since 2007 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170314/403c3b60/attachment.html>
Dan Cropp
2017-Mar-14 21:51 UTC
[asterisk-users] Having problem getting Asterisk to work on CentOS 7
Thanks Tzafrir. Upon further investigation it is safe_asterisk that was the process id I initially saw. I believe this is what was installed when running make config to install the Initialization Scripts in the asterisk 13.14.0 source code Asterisk did not start up previously on a restart. I changed SELINUX setting in /etc/selinux/config (default was enforcing and I changed it to permissive). After that, I was seeing the Asterisk PID. I didn't realize both safe_asterisk pid and asterisk pid were displaying when I executed pgrep asterisk. Admittedly, I'm new to systemd. I need to research it to learn what I need to do. Dan Cropp Senior Software Engineer, R&D Software Dept. AMTELCO, 4800 Curtin Drive, McFarland, WI 53558-9424 608 838-4197 ext. 291 1-800-238-5275 ext 291 www.amtelco.com Statement of Confidentiality The contents of this e-mail message and any attachments are confidential to American Tel-A-Systems, Inc. (AMTELCO), and are intended solely for the addressee(s). The information contained in this transmission also may be of a legally privileged nature. This transmission is sent in trust and is meant solely for delivery to the intended recipient(s). Receipt of this transmission does not convey any right to reproduce or disseminate any of the information it contains. If you are not the intended recipient, please immediately notify the sender by reply e-mail?or telephone?and?delete this message and any attachments. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tzafrir Cohen Sent: Tuesday, March 14, 2017 1:18 PM To: asterisk-users at lists.digium.com Subject: Re: [asterisk-users] Having problem getting Asterisk to work on CentOS 7 On Tue, Mar 14, 2017 at 05:09:17PM +0000, Dan Cropp wrote:> Thank you Tzafrir. > > I had been using different users in earlier attempts to make this work. Decided to try everything where root is the only user, simply to verify it's working. > > For problem 2, where asterisk is writing to the log but doesn't seem to receive the SIP packets even though tcpdump indicates they are making it to the box on 5060, I am starting asterisk while logged in as root. > /usr/sbin/asterisk -vvvvvvvvdddddddc > > > For problem 1, where it seems to be stuck when running as a service, I simply reboot the machine. Then I log it as root and notice it's not writing to the log. > > When running it as a service (after restart). Here is what the output > from strace -p $PID_OF_ASTERISK > > [root at localhost ~]# strace -p 1470pkill? nice? That is not asterisk. Are you sure you got the right process? Maybe you got safe_asterisk instead? If it is safe_asterisk: 1. That script is pointless now that you have systemd. Replace it with a simple systemd unit (hint: Restart=on-failure gets you most of the way there). Isn't there one already included with Asterisk by now? 2. Use the option -f of strace to see the exact error message. What is error status 34 of asterisk? ERANGE? -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users