LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2014, 02:32 PM   #1
rrije
Member
 
Registered: Jul 2010
Distribution: openSUSE 11.4
Posts: 33

Rep: Reputation: Disabled
Debian: init script won't start asterisk, no log output


Hello,

when I issue an '/etc/init.d/asterisk start' or 'service asterisk start' command, nothing happens, except for the single process 'astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 21756' briefly visible in the 'ps ax' output.
I checked /var/log/messages, syslog, daemon.log, asterisk/messages - there is nothing whatsoever.
I can run asterisk normally, and if I issue part of the command from the /etc/init.d/asterisk which goes like '/usr/sbin/asterisk -- -p -U asterisk' it starts. However, the full command 'start-stop-daemon --start --group asterisk --pidfile /var/run/asterisk/asterisk.pid --exec /usr/sbin/asterisk -- -p -U asterisk' produces the effect described above.

This command actually comes from running 'bash -x /etc/init.d/asterisk start'. Here are the last lines of the output:
Quote:
+ start-stop-daemon --start --group asterisk --pidfile /var/run/asterisk/asterisk.pid --exec /usr/sbin/asterisk -- -p -U asterisk
+ echo asterisk.
asterisk.
+ exit 0
Some meaningful background: a few days ago the main hdd started acting up, with SMART going on about how it will die in 24 hours etc. So I dd'd the whole disk (with several partitions) and restored it on another drive. /var and /home were on separate partitions (and quite constrained for space), so I recreated them with greater size and copied data over. Everything was done from the Clonezilla live usb.

Asterisk directory is owned by user asterisk from group asterisk (as it were before), same for /var/run/asterisk/asterisk.pid and /var/run/asterisk/asterisk.ctl.
But as I mentioned before, running init script doesn't produce any error, which in case of bad permissions should (at least it did a while ago when I screwed up during initial configuration).

I tried running the aforementioned command from the initscript with redirection to the logfile like this:
Quote:
start-stop-daemon -v --start --group asterisk --pidfile /var/run/asterisk/asterisk.pid --exec /usr/sbin/asterisk -- -p -U asterisk > /var/log/asterisk/asterisk_debug.log 2>&1
Didn't give any clues, as the log stayed empty. Then I in a fit of blind faith did 'apt-get install asterisk', and that didn't help either.

The system is Debian Wheezy, uname -a goes like this: 'Linux akko 3.9-1-686-pae #1 SMP Debian 3.9.8-1 i686 GNU/Linux', asterisk version is 'Asterisk 11.8.0~dfsg-2'

If anyone could give a hint where to look and what to try, I'd be extremely grateful.
 
Old 03-12-2014, 11:49 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Have you fscked the file systems? And if so, assuming it is an ext* file system, did any files appear in the lost+found directories?

It might be worth trying removing asterisk before installing it, and if that doesn't work purging it before installing it.
 
Old 03-16-2014, 09:46 AM   #3
rrije
Member
 
Registered: Jul 2010
Distribution: openSUSE 11.4
Posts: 33

Original Poster
Rep: Reputation: Disabled
Thanks for the reply, catkin.

fsck didn't find anything out of order, and lost+found were empty.

Purged asterisk, installed it again, copied old /etc/asterisk back, 'chown -R asterisk.asterisk /etc/asterisk', and it works.
I tried to run strace on the non-working startup script, but to my inexperienced eye it didn't produce any errors, so I still don't know what made it behave this way.

Anyway, thanks for your help. Marking the thread as 'solved'.
 
  


Reply

Tags
asterisk, init script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Init script in /etc/init.d does not start at boot tdnnash25 Linux - Server 4 12-18-2009 05:40 PM
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 01:51 PM
custom init.d script will start but won't stop Qwerty9119 Linux - General 2 05-03-2007 01:23 PM
init script won't run at log-off dimangi Linux - Newbie 1 10-29-2003 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration