fun requestMysqlFixperms () =
let
- val (_, bio) = requestBio (fn () => ())
+ val (_, context) = requestContext (fn () => ())
+ val bio = OpenSSL.connect true (context,
+ Config.Dbms.dbmsNode ^ ":" ^ Int.toString Config.slavePort)
in
Msg.send (bio, MsgMysqlFixperms);
case Msg.recv bio of
(describeQuery q,
NONE)))
(fn () => ())
-
- | MsgMysqlFixperms =>
- (print "Starting mysql-fixperms\n";
- doIt (fn () => if OS.Process.isSuccess
- (OS.Process.system "/usr/bin/sudo -H /afs/hcoop.net/common/etc/scripts/mysql-grant-table-drop") then
- ("Requested mysql-fixperms",
- NONE)
- else
- ("Requested mysql-fixperms, but execution failed!",
- SOME "Script execution failed."))
- (fn () => ()))
-
| MsgDescribe dom =>
doIt (fn () => if not (Domain.validDomain dom) then
("Requested description of invalid domain " ^ dom,
("Invalid database name " ^ user ^ "_" ^ dbname,
SOME ("Invalid database name " ^ dbname)))
(fn () => ())
+ | MsgMysqlFixperms =>
+ (print "Starting mysql-fixperms\n";
+ doIt (fn () => if OS.Process.isSuccess
+ (OS.Process.system "/usr/bin/sudo -H /afs/hcoop.net/common/etc/scripts/mysql-grant-table-drop") then
+ ("Requested mysql-fixperms",
+ NONE)
+ else
+ ("Requested mysql-fixperms, but execution failed!",
+ SOME "Script execution failed."))
+ (fn () => ()))
+
| _ => (OpenSSL.close bio;
loop ())
end