Cronjob - Restart vicidial

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Cronjob - Restart vicidial

Postby phil_discount » Wed Feb 26, 2014 2:37 am

Hello,

i just want to restart vicidial with a cronjob every morning, i can't do a reboot.
if i execute the script vom command line, it works, but as a cronjob -it doesen't.
i tried the following
Code: Select all
0 5 * * * /etc/init.d/vicidial restart
0 5 * * * bash -c "/etc/init.d/vicidial restart"


i only see this in /var/log/messages
Code: Select all
Feb 26 08:28:02 ka-vici-demo kernel: [ 1763.217380] dahdi: Telephony Interface Unloaded
Feb 26 08:28:02 ka-vici-demo kernel: [ 1763.609981] dahdi: Telephony Interface Registered on major 196
Feb 26 08:28:02 ka-vici-demo kernel: [ 1763.609987] dahdi: Version: 2.3.0.1
Feb 26 08:28:05 ka-vici-demo kernel: [ 1766.629007] dahdi: Registered tone zone 0 (United States / North America)

asterisk stops, but nothing else.

i'm using vicibox redux 3.0.5

regards
philip
ViciBox Redux 3.0.5 | Vicidial 2.2.1-260 100527-2211 | Asterisk 1.4.27.1
9xVicidial 8-core 2.5GHz,4GB,SSD
4xWeb 4-core 2.5GHz,4GB,SSD
DB: 24-core-1.9GHz AMD,96GB,8xSSD Raid10
3xDBslave 4-core 2.5GHz,4GB,SSD (for SELECT: Reporting/LIVE)
400 seats
phil_discount
 
Posts: 468
Joined: Thu Jun 18, 2009 8:44 am
Location: Deutschland/Schweiz/Österreich

Re: Cronjob - Restart vicidial

Postby williamconley » Wed Feb 26, 2014 3:35 pm

If you are not going to perform a reboot, you are wasting time trying to restart Vicidial and more likely to cause problems than to solve them.

A reboot will unquestionably clean out everything. Attempting to restart individual processes without rebooting will likely break links and cause errors that may last beyond your attempt, having the opposite effect of your goal.

You could restart services (mysql, apache2, etc), but even that will cause errors and this is linux, any error could leave a broken link or memory lock (there is so much interaction between packages in this system that a hiccup is inevitable from this process if you do it enough times).

So my advice: If you can't reboot, don't mess with it.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cronjob - Restart vicidial

Postby phil_discount » Wed Feb 26, 2014 6:27 pm

i know what u mean.
but i've got problems with starting one server. sometimes he hangs while initialzing memory.
the new server comes in 2 weeks. until the the server is installed i don't want to reboot the server.
just in the morning a reload of vicidial.

the script from console works fine, so i just thought there is a litte mistake in my crontab to restart vicidial.

and sometimes asterisk stops without any hint. i made a cronjob who checks asterisk every minute and restarts vicidial if asterisk is down.
not optimal, but better than do it manually.
ViciBox Redux 3.0.5 | Vicidial 2.2.1-260 100527-2211 | Asterisk 1.4.27.1
9xVicidial 8-core 2.5GHz,4GB,SSD
4xWeb 4-core 2.5GHz,4GB,SSD
DB: 24-core-1.9GHz AMD,96GB,8xSSD Raid10
3xDBslave 4-core 2.5GHz,4GB,SSD (for SELECT: Reporting/LIVE)
400 seats
phil_discount
 
Posts: 468
Joined: Thu Jun 18, 2009 8:44 am
Location: Deutschland/Schweiz/Österreich

Re: Cronjob - Restart vicidial

Postby williamconley » Wed Feb 26, 2014 7:59 pm

replace your memory (and cross your fingers)

if you have more than 4G ... take half out. if it crashes again, put those back and take out the other half.

and hope it's not your HD, but get a GOOOOOOOD backup OFF that server immediately (and nightly!!) ... (actually, in those circumstances, I'd do it hourly, but that's me ... LOL)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cronjob - Restart vicidial

Postby phil_discount » Thu Feb 27, 2014 2:14 am

the server is only one of eight clusters .. no critical data. voicefiles are copied nightly to an external storage.

but the asterisk crashes are on differnet servers with differnt versions of asterisk.
so it will be nice if i can do a cronjob to restart vicidial if asterisk stops.

do u have any idea why i cant restart vicidial over a cronjob like this /etc/init.d/vicidial restart?
ViciBox Redux 3.0.5 | Vicidial 2.2.1-260 100527-2211 | Asterisk 1.4.27.1
9xVicidial 8-core 2.5GHz,4GB,SSD
4xWeb 4-core 2.5GHz,4GB,SSD
DB: 24-core-1.9GHz AMD,96GB,8xSSD Raid10
3xDBslave 4-core 2.5GHz,4GB,SSD (for SELECT: Reporting/LIVE)
400 seats
phil_discount
 
Posts: 468
Joined: Thu Jun 18, 2009 8:44 am
Location: Deutschland/Schweiz/Österreich

Re: Cronjob - Restart vicidial

Postby geoff3dmg » Thu Feb 27, 2014 4:18 am

Why not fix the problem properly and take the server out of the cluster until the hardware is fixed/replaced. If it's just a telephony server like you say, it's very easy to do.
Vicibox 5.03 from .iso | VERSION: 2.10-451a BUILD: 140902-0816 | Asterisk 1.8.28.2-vici | Multi-Server | Amfeltec H/W Timing Cards | No Extra Software After Installation | Dell PowerEdge 1850 | Pentium 4 'Prescott' Xenon Quad @ 3.40GHz
geoff3dmg
 
Posts: 403
Joined: Tue Jan 29, 2013 4:35 am
Location: Lancashire, UK

Re: Cronjob - Restart vicidial

Postby phil_discount » Thu Feb 27, 2014 4:46 am

i said already. sometimes asterisk crashes and we dont know why.
until we solved the problem it will be nice to have a cronjob who checks asterisk and if need to restart vicidial.

i know thats not the perfect way .. but we have a crash every two weeks (13 telephony server).
but its not every time the same server .. strange.
ViciBox Redux 3.0.5 | Vicidial 2.2.1-260 100527-2211 | Asterisk 1.4.27.1
9xVicidial 8-core 2.5GHz,4GB,SSD
4xWeb 4-core 2.5GHz,4GB,SSD
DB: 24-core-1.9GHz AMD,96GB,8xSSD Raid10
3xDBslave 4-core 2.5GHz,4GB,SSD (for SELECT: Reporting/LIVE)
400 seats
phil_discount
 
Posts: 468
Joined: Thu Jun 18, 2009 8:44 am
Location: Deutschland/Schweiz/Österreich

Re: Cronjob - Restart vicidial

Postby geoff3dmg » Thu Feb 27, 2014 5:18 am

I assume you're restarting your telephony servers overnight anyway? If you are using phone aliasing a telephony server failure should not stop your agents from working either (relogin and they are good to go).
Vicibox 5.03 from .iso | VERSION: 2.10-451a BUILD: 140902-0816 | Asterisk 1.8.28.2-vici | Multi-Server | Amfeltec H/W Timing Cards | No Extra Software After Installation | Dell PowerEdge 1850 | Pentium 4 'Prescott' Xenon Quad @ 3.40GHz
geoff3dmg
 
Posts: 403
Joined: Tue Jan 29, 2013 4:35 am
Location: Lancashire, UK

Re: Cronjob - Restart vicidial

Postby williamconley » Thu Feb 27, 2014 11:29 am

Instead of restarting "vicidial" when asterisk crashes, find the command that pushes the "start asterisk" command into the "asterisk" screen. And execute that command.

When we find a machine upon which asterisk has crashed, we issue "screen -r asterisk" which allows us to view the Astrisk screen. In that screen, if asterisk has crashed, will be a simple command prompt. In most cases, pushing the up arrow (previous command issued) provides the exact command issued to start asterisk originally.

So when you find asterisk not running, find the command that pushed that "start asterisk" command into that screen .. and issue it again. Instead of battling dahdi. Or force dadhi process to terminate before attempting to restart vicidial.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Cronjob - Restart vicidial

Postby mflorell » Fri Feb 28, 2014 6:25 am

I added an auto-restart Asterisk feature to Admin -> Servers a couple months ago in svn/trunk and it seems to work very well in production.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Cronjob - Restart vicidial

Postby williamconley » Fri Feb 28, 2014 10:18 pm

Yes! I forgot all about that! I've seen it but never had a client who needed it (at least not since I observed its existence ...)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 94 guests