X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/65825353f7f92a1a524c8d887eda2b72dc5019a6..31b50af0d7e9779f3b0bd3f67acfc9104512a39d:/src/plugins/apache.sml diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index be0e4f2..1f0fe83 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -275,17 +275,21 @@ val () = Slave.registerFileHandler (fn fs => vhostsChanged := true; case #action fs of Slave.Delete => - (if !logDeleted then - () - else - (ignore (OS.Process.system (down ())); - logDeleted := true); - ignore (OS.Process.system (Config.rm - ^ " -rf " - ^ realVhostFile)); - ignore (OS.Process.system (Config.rm - ^ " -rf " - ^ realLogDir oldUser))) + let + val ldir = realLogDir oldUser + in + if !logDeleted then + () + else + (ignore (OS.Process.system (down ())); + logDeleted := true); + ignore (OS.Process.system (Config.rm + ^ " -rf " + ^ realVhostFile)); + Slave.moveDirCreate {from = ldir, + to = Config.Apache.backupLogDirOf + (isVersion1 (Slave.hostname ()))} + end | Slave.Add => let val rld = realLogDir user @@ -298,7 +302,9 @@ val () = Slave.registerFileHandler (fn fs => if Posix.FileSys.access (rld, []) then () else - Slave.mkDirAll rld + Slave.moveDirCreate {from = Config.Apache.backupLogDirOf + (isVersion1 (Slave.hostname ())), + to = rld} end | _ =>