diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2012-07-13 15:17:37 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2012-07-13 15:17:37 -0700 |
commit | 3595c131e9d438a6ad159d6b43db05d9e5bc4e13 (patch) | |
tree | c4a1cc05f00b10bd2d75058ce4474b683f1396aa /scripts | |
parent | 138bc5da67d51700b32dacdbdb4b86373695f069 (diff) | |
download | vyatta-cfg-3595c131e9d438a6ad159d6b43db05d9e5bc4e13.tar.gz vyatta-cfg-3595c131e9d438a6ad159d6b43db05d9e5bc4e13.zip |
Fix syslog level for commit messages
Bug 8208
The log level should be notice not alert.
Also, the script doesn't depend on anything in Vyatta config
or other Vyatta perl libaries.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-log-commit.pl | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/scripts/vyatta-log-commit.pl b/scripts/vyatta-log-commit.pl index e7e38b2..bbf0852 100644 --- a/scripts/vyatta-log-commit.pl +++ b/scripts/vyatta-log-commit.pl @@ -26,33 +26,25 @@ # Description: Script to log active configuration commits to syslog. # # **** End License **** -# - use strict; use warnings; -use lib '/opt/vyatta/share/perl5/'; -use Vyatta::Config; use Sys::Syslog qw(:standard :macros); use POSIX qw(ttyname); # # main # -my $commit_status; -my $cur_tty = ttyname(0); -my $cur_user = getlogin() || getpwuid($<) || "unknown"; my $status = $ENV{'COMMIT_STATUS'}; - -chomp($cur_tty); -chomp($cur_user); - -$commit_status = 'Successful' if ($status eq 'SUCCESS'); +my $commit_status = 'Successful' if ($status eq 'SUCCESS'); #open log for logging commit details if (defined $commit_status) { - openlog("commit", "", LOG_USER); - syslog ("alert", "$commit_status change to active configuration by user $cur_user on $cur_tty"); - closelog(); + my $cur_tty = ttyname(0); + my $cur_user = getlogin() || getpwuid($<) || "unknown"; + + openlog("commit", "", LOG_USER); + syslog (LOG_NOTICE, "$commit_status change to active configuration by user $cur_user on $cur_tty"); + closelog(); } #end of script |