Use correct reload method and restart command on Debian
authorJamie Cameron <jcameron@webmin.com>
Fri, 16 Nov 2007 01:33:37 +0000 (01:33 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 16 Nov 2007 01:33:37 +0000 (01:33 +0000)
syslog/CHANGELOG
syslog/config-debian-linux-3.1-* [new file with mode: 0644]
syslog/config.info
syslog/syslog-lib.pl

index 92dee3c..ffb3463 100644 (file)
@@ -7,3 +7,5 @@ When viewing a log file, the contents of the newest rotated version will be show
 Error logs from Webmin and Usermin, and kernel messages are now viewable in this module.
 ---- Changes since 1.300 ----
 Added a Module Config option to specifying other log files that should be searchable, and a similar ACL option to add logs on a per-user basis.
+---- Changes since 1.380 ----
+On Debian systems, use a syslog restart to tell it to re-open log files, as a HUP signal is not reliable.
diff --git a/syslog/config-debian-linux-3.1-* b/syslog/config-debian-linux-3.1-*
new file mode 100644 (file)
index 0000000..4bf9e5e
--- /dev/null
@@ -0,0 +1,18 @@
+pri_all=1
+syslogd=/sbin/syslogd
+m4_conf=0
+syslog_conf=/etc/syslog.conf
+pri_dir=1
+pid_file=/var/run/syslogd.pid
+facilities=auth authpriv cron daemon kern lpr mail mark news syslog user uucp local0 local1 local2 local3 local4 local5 local6 local7
+m4_path=
+sync=1
+pipe=1
+tags=0
+lines=20
+socket=0
+start_cmd=/etc/init.d/sysklogd start
+restart_cmd=/etc/init.d/sysklogd reload
+signal_cmd=/etc/init.d/sysklogd restart
+compressed=1
+others=1
index 16c40b0..8bc00df 100644 (file)
@@ -19,4 +19,5 @@ syslogd=Path to syslog server,0
 facilities=Supported facilities,0
 start_cmd=Command to start syslog,3,Just run server
 restart_cmd=Command to apply changes,3,Kill and re-start server
+signal_cmd=Command to re-open log files,3,Send HUP signal
 tail_cmd=Tail command and arguments,3,Default (tail -n LINES)
index 6960d2d..2cffcb2 100644 (file)
@@ -234,9 +234,15 @@ return undef;
 # Tell the syslog server to re-open it's log files
 sub signal_syslog
 {
-local $pid = &get_syslog_pid();
-if ($pid) {
-       &kill_logged('HUP', $pid);
+if ($config{'signal_cmd'}) {
+       &system_logged("$config{'signal_cmd'} >/dev/null 2>/dev/null </dev/null");
+       }
+else {
+       # Use HUP signal
+       local $pid = &get_syslog_pid();
+       if ($pid) {
+               &kill_logged('HUP', $pid);
+               }
        }
 }