Add MySQL skeleton
[hcoop/domtool2.git] / src / plugins / webalizer.sml
index 2237fe5..7ac523b 100644 (file)
@@ -33,6 +33,8 @@ val () = Apache.registerPre
                                   in
                                       TextIO.output (fd, "LogFile\t");
                                       TextIO.output (fd, Config.homeBase);
+                                      TextIO.output (fd, "/");
+                                      TextIO.output (fd, user);
                                       TextIO.output (fd, "/apache/log/");
                                       TextIO.output (fd, node);
                                       TextIO.output (fd, "/");
@@ -81,12 +83,16 @@ val () = Slave.registerFileHandler (fn fs =>
                                                                                ^ " -f "
                                                                                ^ Config.Webalizer.configDir
                                                                                ^ "/"
+                                                                               ^ Slave.hostname ()
+                                                                               ^ "/"
                                                                                ^ base
                                                                                ^ ".conf"));
                                                     ignore (OS.Process.system (Config.rm
                                                                                ^ " -rf "
                                                                                ^ Config.Webalizer.outputDir
                                                                                ^ "/"
+                                                                               ^ Slave.hostname ()
+                                                                               ^ "/"
                                                                                ^ base)))
                                                  | _ =>
                                                    (ignore (OS.Process.system (Config.cp
@@ -95,10 +101,12 @@ val () = Slave.registerFileHandler (fn fs =>
                                                                                ^ " "
                                                                                ^ Config.Webalizer.configDir
                                                                                ^ "/"
+                                                                               ^ Slave.hostname ()
+                                                                               ^ "/"
                                                                                ^ base
                                                                                ^ ".conf"));
                                                     let
-                                                        val dir = Config.Webalizer.outputDir ^ "/" ^ base
+                                                        val dir = Config.Webalizer.outputDir ^ "/" ^ Slave.hostname () ^ "/" ^ base
                                                     in
                                                         if Posix.FileSys.access (dir, []) then
                                                             ()
@@ -108,4 +116,10 @@ val () = Slave.registerFileHandler (fn fs =>
                                             | _ => ()
                                       end)
 
+val () = Domain.registerResetLocal (fn () =>
+                                      app (fn (node, _) =>
+                                              ignore (OS.Process.system (Config.rm ^ " -rf "
+                                                                         ^ Config.Webalizer.configDir ^ "/"
+                                                                         ^ node ^ "/*"))) Config.nodeIps)
+
 end