Thinking this issue through further, it looks like when the web server stops, the script is actually working, but it is not able to continue with the ‘restart’ process as the web server has stopped, and thus the script seems to not continue to run…does this sound about right? If you run omd restart apache from CLI it is not really a ‘restart’ so much as a ‘stop’ and then a ‘start’. Is there perhaps another command I can run to get the site apache to re-read/reload the web files? Perhaps like an init.d/apache2 restart, would that be the same as restarting the omd site specific apache? I ask because the actual apache2 has a ‘restart’ and a ‘reload’ command.
Thanks
Jason
From: checkmk-en-bounces@lists.mathias-kettner.de checkmk-en-bounces@lists.mathias-kettner.de on behalf of Jason Humes JHumes@acs.on.ca
Sent: Thursday, March 19, 2015 12:57 PM
To: Joerg Linge
Cc: checkmk-en@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Any thoughts on how to restart OMD apache from a web link?
If I do like this;
shell_exec(‘sudo -u portaldev /opt/omd/sites/portaldev/bin/omd restart apache’);
And have these in sudoers as tests;
www-data ALL=NOPASSWD:/opt/omd/sites/portaldev/bin/omd restart portaldev apache
portaldev ALL=NOPASSWD:/opt/omd/sites/portaldev/bin/omd restart portaldev apache
portaldev ALL=(ALL:ALL) /opt/omd/sites/portaldev/bin/omd restart portaldev apache
portaldev ALL=NOPASSWD:/opt/omd/sites/portaldev/bin/omd restart apache
portaldev ALL=(ALL:ALL) /opt/omd/sites/portaldev/bin/omd restart apache
Then I can get the server to stop, but it seems more like a crash as it doesn’t restart;
[Thu Mar 19 12:54:42.803662 2015] [mpm_prefork:notice] [pid 26024] AH00169: caught SIGTERM, shutting down
From: checkmk-en-bounces@lists.mathias-kettner.de checkmk-en-bounces@lists.mathias-kettner.de on behalf of Jason Humes JHumes@acs.on.ca
Sent: Thursday, March 19, 2015 12:47 PM
To: Joerg Linge
Cc: checkmk-en@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Any thoughts on how to restart OMD apache from a web link?
Strange…I can’t seem to figure this out…I’ve tried all sorts of versions of the command ‘omd restart portaldev apache’ with no luck. Any other thoughts on how I can achieve a reload of the apache web server when clicking on a link in multisite? I’ve tried adding the command to the /etc/sudoers file and tried nesting the commands in a shell script and still no luck.
Thoughts/ideas?
Thanks
Jason
From: checkmk-en-bounces@lists.mathias-kettner.de checkmk-en-bounces@lists.mathias-kettner.de on behalf of Jason Humes JHumes@acs.on.ca
Sent: Thursday, March 19, 2015 12:01 PM
To: Joerg Linge
Cc: checkmk-en@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Any thoughts on how to restart OMD apache from a web link?
Hrmmm, no such luck.
From: checkmk-en-bounces@lists.mathias-kettner.de checkmk-en-bounces@lists.mathias-kettner.de on behalf of Joerg Linge pitchfork@ederdrom.de
Sent: Thursday, March 19, 2015 11:31 AM
Cc: checkmk-en@lists.mathias-kettner.de
Subject: Re: [Check_mk (english)] Any thoughts on how to restart OMD apache from a web link?
sudo -u portaldev omd restart apache
Am 19.03.2015 um 16:22 schrieb Jason Humes JHumes@acs.on.ca:
Trying to do something like this results in an odd error from omd;
sudo -u www-data omd restart portaldev apache
omd: no such site: www-data
From: checkmk-en-bounces@lists.mathias-kettner.de checkmk-en-bounces@lists.mathias-kettner.de on behalf of Jason Humes JHumes@acs.on.ca
Sent: Thursday, March 19, 2015 10:33 AM
To: checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] Any thoughts on how to restart OMD apache from a web link?
Hi
I’ve written a script/plugin for check_mk and in order for the changes it makes to work I need to restart the apache web server for the omd site in question. I’ve tried to write a simple php script and link to it from the GUI, but it only seems to cause the omd apache server to stop, and not restart. Any thoughts on how I can achieve running ‘omd restart apache’ or ‘omd restart sitename apache’ from the web? I’ve got the script executable from the webserver user. Here is what I’ve got now;
html.write("<a href='./restart_omd.php' target='main' >Activate Changes (Restart Apache)</a><br>")
##restart_omd.php##
<?php
#$output = shell_exec(‘omd restart apache’);
#echo “
$output
”;
echo shell_exec(‘omd restart apache’);
?>
Thanks
Jason
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en