Fixed action logging messages
authorJamie Cameron <jcameron@webmin.com>
Tue, 13 Jan 2009 22:49:32 +0000 (22:49 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 13 Jan 2009 22:49:32 +0000 (22:49 +0000)
init/images/smallicon.gif
init/lang/en
init/log_parser.pl
init/start_stop.cgi

index e69de29..beadf3a 100644 (file)
Binary files a/init/images/smallicon.gif and b/init/images/smallicon.gif differ
index 49a5bf1..ff32cb5 100644 (file)
@@ -118,8 +118,12 @@ log_rename=Renamed action $1 to $2
 log_modify=Modified action $1
 log_create=Created action $1
 log_delete=Deleted action $1
-log_start=Started bootup action $1
-log_stop=Stopped shutdown action $1
+log_start=Started action $1
+log_stop=Stopped action $1
+log_restart=Restarted action $1
+log_condrestart=Conditionally restarted action $1
+log_reload=Reloaded action $1
+log_status=Fetched status of action $1
 log_reboot=Rebooted system
 log_shutdown=Shutdown system
 log_local=Modified bootup script
index 6b4e724..bea83e6 100644 (file)
@@ -23,11 +23,8 @@ elsif ($action eq 'create') {
 elsif ($action eq 'delete') {
        return &text('log_delete', "<tt>$object</tt>");
        }
-elsif ($action eq 'start') {
-       return &text('log_start', "<tt>$object</tt>");
-       }
-elsif ($action eq 'stop') {
-       return &text('log_stop', "<tt>$object</tt>");
+elsif ($type eq 'action') {
+       return &text('log_'.$action, "<tt>$object</tt>");
        }
 elsif ($action eq 'reboot') {
        return $text{'log_reboot'};
index 6794403..9698bb3 100755 (executable)
@@ -10,30 +10,14 @@ $access{'bootup'} || &error($text{'ss_ecannot'});
 # Work out the correct command, and show header
 $| = 1;
 $theme_no_header = 1;
-if (defined($in{'start'})) {
-       &ui_print_header(undef, $text{'ss_start'}, "");
-       $cmd = "$in{'file'} start";
-       }
-elsif (defined($in{'restart'})) {
-       &ui_print_header(undef, $text{'ss_restart'}, "");
-       $cmd = "$in{'file'} restart";
-       }
-elsif (defined($in{'condrestart'})) {
-       &ui_print_header(undef, $text{'ss_restart'}, "");
-       $cmd = "$in{'file'} condrestart";
-       }
-elsif (defined($in{'reload'})) {
-       &ui_print_header(undef, $text{'ss_reload'}, "");
-       $cmd = "$in{'file'} reload";
-       }
-elsif (defined($in{'status'})) {
-       &ui_print_header(undef, $text{'ss_status'}, "");
-       $cmd = "$in{'file'} status";
-       }
-else {
-       &ui_print_header(undef, $text{'ss_stop'}, "");
-       $cmd = "$in{'file'} stop";
+foreach $a ('start', 'restart', 'condrestart', 'reload', 'status', 'stop') {
+       if (defined($in{$a})) {
+               $action = $a;
+               }
        }
+$action ||= 'stop';
+&ui_print_header(undef, $text{'ss_'.$action}, "");
+$cmd = $in{'file'}." ".$action;
 
 # In case the action was Webmin
 $SIG{'TERM'} = 'IGNORE';
@@ -43,7 +27,7 @@ print &text('ss_exec', "<tt>$cmd</tt>"),"<p>\n";
 print "<pre>";
 &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
 print "</pre>\n";
-&webmin_log($in{'start'} ? 'start' : 'stop', 'action', $in{'name'});
+&webmin_log($action, 'action', $in{'name'});
 
 &ui_print_footer($in{'back'}, $text{'edit_return'});