aboutsummaryrefslogtreecommitdiffstats
path: root/add-syslog
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2010-02-04 19:49:56 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2010-02-04 19:49:56 +0000
commit162b766c589b4c2c4dabcd39a9142f0dd0cd6988 (patch)
tree68b90d17bcd3e671eb12e2608a5817618eeb5002 /add-syslog
parent0a5f229aaeb77826b4daa8c7d51a7212aae527b7 (diff)
downloadrpm-helper-162b766c589b4c2c4dabcd39a9142f0dd0cd6988.tar
rpm-helper-162b766c589b4c2c4dabcd39a9142f0dd0cd6988.tar.gz
rpm-helper-162b766c589b4c2c4dabcd39a9142f0dd0cd6988.tar.bz2
rpm-helper-162b766c589b4c2c4dabcd39a9142f0dd0cd6988.tar.xz
rpm-helper-162b766c589b4c2c4dabcd39a9142f0dd0cd6988.zip
only add configuration entry if target syslog implementation is installed
Diffstat (limited to 'add-syslog')
-rwxr-xr-xadd-syslog8
1 files changed, 5 insertions, 3 deletions
diff --git a/add-syslog b/add-syslog
index ea28c66..e9b7982 100755
--- a/add-syslog
+++ b/add-syslog
@@ -37,7 +37,6 @@ EOF
exit(0) if $number == 2;
# check arguments
-
die "invalid facility '$facility'" if $facility && !$facilities{$facility};
die "invalid min priority '$min'" if $min && ! defined $priorities{$min};
@@ -52,10 +51,13 @@ EOF
my $release = $1;
close($fh);
+ # add an entry to default syslog implementation, if installed
if (version->parse($release) < version->parse("2010.1")) {
- add_sysklogd_entry($package, $source, $dest, $facility, $min, $max);
+ add_sysklogd_entry($package, $source, $dest, $facility, $min, $max)
+ if -f '/etc/init.d/syslog';
} else {
- add_rsyslog_entry($package, $source, $dest, $facility, $min, $max);
+ add_rsyslog_entry($package, $source, $dest, $facility, $min, $max)
+ if -f '/etc/init.d/rsyslog';
}
}