Added support for CSW logrotate from Solaris 10
authorJamie Cameron <jcameron@webmin.com>
Thu, 3 May 2007 17:20:39 +0000 (17:20 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 3 May 2007 17:20:39 +0000 (17:20 +0000)
logrotate/config-solaris-10-* [new file with mode: 0644]
logrotate/index.cgi
logrotate/logrotate-lib.pl

diff --git a/logrotate/config-solaris-10-* b/logrotate/config-solaris-10-*
new file mode 100644 (file)
index 0000000..485fb2c
--- /dev/null
@@ -0,0 +1,4 @@
+sort_mode=0
+logrotate_conf=/opt/csw/etc/logrotate.conf
+sample_conf=/opt/csw/etc/logrotate.conf.CSW
+logrotate=/opt/csw/bin/logrotate
index d04aa2d..aeb15e5 100755 (executable)
@@ -19,10 +19,6 @@ if (!&has_command($config{'logrotate'})) {
        &ui_print_footer("/", $text{'index'});
        exit;
        }
-if (!-r $config{'logrotate_conf'} && -r $config{'sample_conf'}) {
-       # No .. but a sample does. Use it
-       system("cp $config{'sample_conf'} $config{'logrotate_conf'}");
-       }
 if (!-r $config{'logrotate_conf'}) {
        &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
        &ui_print_endpage(
index 3d95fcd..9bfaa39 100644 (file)
@@ -11,6 +11,11 @@ if (open(VERSION, "$module_config_directory/version")) {
        close(VERSION);
        }
 
+# Use sample config if it exists but real config doesn't yet
+if (!-r $config{'logrotate_conf'} && -r $config{'sample_conf'}) {
+       &copy_source_dest($config{'sample_conf'}, $config{'logrotate_conf'});
+       }
+
 sub get_config_parent
 {
 if (!$get_config_parent_cache) {