summaryrefslogtreecommitdiff
path: root/scripts/system/vyatta_update_logrotate.pl
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-19 11:25:38 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-19 11:25:38 -0700
commit724e9418e3f6acf81fcc29172de6c1f5e3335fa7 (patch)
tree384b0be3e93a8de0b0d890f5fee18d04590ea01c /scripts/system/vyatta_update_logrotate.pl
parent20c7a06a9dd38fb705a245cb755a351241113461 (diff)
downloadvyatta-cfg-724e9418e3f6acf81fcc29172de6c1f5e3335fa7.tar.gz
vyatta-cfg-724e9418e3f6acf81fcc29172de6c1f5e3335fa7.zip
move "system" configuration templates/scripts to vyatta-cfg-system.
Diffstat (limited to 'scripts/system/vyatta_update_logrotate.pl')
-rw-r--r--scripts/system/vyatta_update_logrotate.pl50
1 files changed, 0 insertions, 50 deletions
diff --git a/scripts/system/vyatta_update_logrotate.pl b/scripts/system/vyatta_update_logrotate.pl
deleted file mode 100644
index abc4a25..0000000
--- a/scripts/system/vyatta_update_logrotate.pl
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-
-my $file = "messages";
-my $log_file = "/var/log/messages";
-if ($#ARGV == 3) {
- $file = shift;
- $log_file = "/var/log/user/$file";
-}
-my $files = shift;
-my $size = shift;
-my $set = shift;
-my $log_conf = "/etc/logrotate.d/$file";
-
-if (!defined($files) || !defined($size) || !defined($set)) {
- exit 1;
-}
-
-if (!($files =~ m/^\d+$/) || !($size =~ m/^\d+$/)) {
- exit 2;
-}
-
-# just remove it and make a new one below
-# (the detection mechanism in XORP doesn't work anyway)
-unlink $log_conf;
-
-open(OUT, ">>$log_conf") or exit 3;
-if ($set == 1) {
- print OUT <<EOF;
-$log_file {
- missingok
- notifempty
- rotate $files
- size=${size}k
- postrotate
- kill -HUP `cat /var/run/syslogd.pid`
- endscript
-}
-EOF
-}
-close OUT;
-
-sleep 1;
-if (system("/usr/sbin/invoke-rc.d sysklogd restart")) {
- exit 4;
-}
-
-exit 0;
-