From 41dcf537be5895440f3a7bf757000e19609fac4b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 13 Jan 2009 22:49:32 +0000 Subject: [PATCH] Fixed action logging messages --- init/images/smallicon.gif | Bin 0 -> 424 bytes init/lang/en | 8 ++++++-- init/log_parser.pl | 7 ++----- init/start_stop.cgi | 32 ++++++++------------------------ 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/init/images/smallicon.gif b/init/images/smallicon.gif index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..beadf3a42e5875a493b4b77cb84fa02a237fb24d 100644 GIT binary patch literal 424 zcmZ?wbh9u|lwgoxxXJ(mpFjWiSp0wH%$d)g{XcW&|B^k|mlbzCd-m+inKL(UKAV@@ z(bY5cz<~p2&OA%*yLWTu%;`1j8X6kr%wN;B<5~6UhiPeP|NsB5Ovv85|HS9dpB)?= zdZG$$0(Cz7ye6RuWX8?UwH158R#BhO0T~JM3j^C(2i_zPl`OpzON=@tBIX60X4tq! zNl>hzjC(`CT5p~5*Hb;D9%Pr@`D=DA!SMF#oCT{t8SbqMH(MMK94Zv*#39Ss=@!=wRr r=jE&Lb>Hv5Qk=;6HB>?2onylT{mvCZOW4HrJZfxkZlBV`z+epk67-m| literal 0 HcmV?d00001 diff --git a/init/lang/en b/init/lang/en index 49a5bf147..ff32cb52c 100644 --- a/init/lang/en +++ b/init/lang/en @@ -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 diff --git a/init/log_parser.pl b/init/log_parser.pl index 6b4e7249e..bea83e61b 100644 --- a/init/log_parser.pl +++ b/init/log_parser.pl @@ -23,11 +23,8 @@ elsif ($action eq 'create') { elsif ($action eq 'delete') { return &text('log_delete', "$object"); } -elsif ($action eq 'start') { - return &text('log_start', "$object"); - } -elsif ($action eq 'stop') { - return &text('log_stop', "$object"); +elsif ($type eq 'action') { + return &text('log_'.$action, "$object"); } elsif ($action eq 'reboot') { return $text{'log_reboot'}; diff --git a/init/start_stop.cgi b/init/start_stop.cgi index 6794403a4..9698bb346 100755 --- a/init/start_stop.cgi +++ b/init/start_stop.cgi @@ -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', "$cmd"),"

\n"; print "

";
 &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
 print "
\n"; -&webmin_log($in{'start'} ? 'start' : 'stop', 'action', $in{'name'}); +&webmin_log($action, 'action', $in{'name'}); &ui_print_footer($in{'back'}, $text{'edit_return'});