diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 23:50:01 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 23:50:01 +0000 |
commit | 3d13f7801a5a2a2d7b97fd309f7ec3c1597232cb (patch) | |
tree | 40b573f76b15cb592c12ca7ddfaa9512a6c7b705 /usr/local/www/status_services.php | |
parent | f8e335a3161234d680a0b413eba89b2ec68d6437 (diff) | |
download | pfsense-3d13f7801a5a2a2d7b97fd309f7ec3c1597232cb.zip pfsense-3d13f7801a5a2a2d7b97fd309f7ec3c1597232cb.tar.gz |
If a service fails to start (ruh roh) then output to the web browser the error message
Diffstat (limited to 'usr/local/www/status_services.php')
-rwxr-xr-x | usr/local/www/status_services.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index 286e1c8..d23f80c 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -76,10 +76,12 @@ if($_GET['restartservice'] == "true") { mwexec("/sbin/killall $executable_name"); mwexec("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); $status = is_service_running($executable_name); - if($status == 1) + if($status == 1) { $savemsg = "{$package_name} has been restarted."; - else - $savemsg = "There was a error restarting {$package_name}."; + } else { + $error_message = exec_command("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); + $savemsg = "There was a error restarting {$package_name}.<p>{$error_message}"; + } } if($_GET['stopservice'] == "true") { @@ -89,10 +91,12 @@ if($_GET['stopservice'] == "true") { if($_GET['startservice'] == "true") { mwexec("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); - if($status == 1) + if($status == 1) { $savemsg = "{$package_name} has been started."; - else - $savemsg = "There was a error starting {$package_name}."; + } else { + $error_message = exec_command("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); + $savemsg = "There was a error restarting {$package_name}.<p>{$error_message}"; + } } |