Page 1 of 1

RMA will not restart apache

Posted: Wed Apr 25, 2007 4:42 am
by mos-eisley
I have a Debian system with an apache and RMA running (well).

A process check check for apache processes, and if this fails, it should execute an Action Profile "RestartLinuxApache", with contains the action "Execute external program", with these attributes:

Image

The Command Line being:

/etc/init.d/apache stop;sleep 5;/etc/init.d/apache start

When I kill the apache process to test, I see this in the syslog:

25-04-2007 12:31:37 Action "Execute external program" executed by RMA "pai05500-1.vfnz.a.p"

But the apache never restarts on the server...why?

Posted: Wed Apr 25, 2007 6:34 am
by KS-Soft Europe
I think, you should create simple script file, e.g. restart_apache.sh, and specify that particular script name into "Command line box", like: /opt/custom/restart_apache.sh

The body of the restart_apache.sh:

Code: Select all

#!/bin/sh

/etc/init.d/apache stop;
sleep 5;
/etc/init.d/apache start
Regards,
Max

Posted: Wed Apr 25, 2007 6:44 am
by mos-eisley
Well, that works - just ¤#%&#¤&&%¤ me off that I need to create, maintain, distribute and execute multiple commands ( e.g. scripts) that way :(

Posted: Wed Apr 25, 2007 7:34 am
by KS-Soft Europe
Sorry, RMA is unable to perform several commands in one line.

Regards,
Max

Posted: Thu Apr 26, 2007 12:29 am
by mos-eisley
Well, this worked:

/etc/init.d/apache restart

Still, multicommand support would be prefered :o