aboutsummaryrefslogtreecommitdiffstats
path: root/add-syslog
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mageia.org>2012-03-08 19:16:26 +0000
committerGuillaume Rousse <guillomovitch@mageia.org>2012-03-08 19:16:26 +0000
commitd8f6c7268e00b808d9d59c0624aee83ab6f5aab0 (patch)
treeaac431a3d17d6bb12413cb9dc96d3b82384d870a /add-syslog
parent332c90458b9c88f04291a84fb62135d7f058ac01 (diff)
downloadrpm-helper-d8f6c7268e00b808d9d59c0624aee83ab6f5aab0.tar
rpm-helper-d8f6c7268e00b808d9d59c0624aee83ab6f5aab0.tar.gz
rpm-helper-d8f6c7268e00b808d9d59c0624aee83ab6f5aab0.tar.bz2
rpm-helper-d8f6c7268e00b808d9d59c0624aee83ab6f5aab0.tar.xz
rpm-helper-d8f6c7268e00b808d9d59c0624aee83ab6f5aab0.zip
actually, we don't care about sysklogd at all anymore
Diffstat (limited to 'add-syslog')
-rwxr-xr-xadd-syslog39
1 files changed, 1 insertions, 38 deletions
diff --git a/add-syslog b/add-syslog
index 50cec83..a6139ff 100755
--- a/add-syslog
+++ b/add-syslog
@@ -44,44 +44,7 @@ EOF
die "maximum priority '$max' lower than minimum priority '$min'"
if $min && $max && ($priorities{$max} < $priorities{$min});
- my $release_file = '/etc/release';
- open(my $fh, '<', $release_file)
- or die "can't open $release_file: $!";
- my $line = <$fh>;
- $line =~ /^Mageia release (\d\d\d\d\.\d)/;
- my $release = $1;
- close($fh);
-
- # add an entry to default syslog implementation, if installed
- add_rsyslog_entry($package, $source, $dest, $facility, $min, $max)
- if -f '/etc/init.d/rsyslog';
-}
-
-sub add_sysklogd_entry {
- my ($package, $source, $dest, $facility, $min, $max) = @_;
-
- # ensure source is configured
- add_new_source($source, '/etc/sysconfig/syslog')
- if $source ne '/dev/log';
-
- # compute selector
- my $selector = get_selector($facility, $min, $max);
-
- # compute spacing to keep default configuration file formatting
- my $tabs = length($selector) < 48 ?
- ((48 - length($selector)) / 8) :
- 1;
-
- # append entry
- open(my $out, '>>', '/etc/syslog.conf')
- or die "Can't open /etc/syslog.conf for appending: $!";
- print $out "# BEGIN: Automatically added by $package installation\n";
- print $out "$selector" . ("\t" x $tabs) . "-$dest\n";
- print $out "# END\n";
- close($out);
-
- # relaunch syslog
- system('service syslog condrestart 2>&1 >/dev/null');
+ add_rsyslog_entry($package, $source, $dest, $facility, $min, $max);
}
sub add_rsyslog_entry {