[Pkg-ocaml-maint-commits] r2939 - /trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml

smimram at users.alioth.debian.org smimram at users.alioth.debian.org
Thu Jul 13 16:37:10 UTC 2006


Author: smimram
Date: Thu Jul 13 16:37:09 2006
New Revision: 2939

URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/?sc=1&rev=2939
Log:
Cosmetic.

Modified:
    trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml

Modified: trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml?rev=2939&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml (original)
+++ trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml Thu Jul 13 16:37:09 2006
@@ -1,23 +1,20 @@
-open Unix;;
-
-exception No_home_variable;;
-exception No_home_to_chdir;;
-exception Fails_daemonize;;
-exception Already_running;;
-exception No_pidfile;;
-exception Cant_find_logger;;
-exception Problem_with_logger;;
-exception Invalid_pidfile;;
-exception No_proc_entry of string;;
+open Unix
+
+exception No_home_variable
+exception No_home_to_chdir
+exception Fails_daemonize
+exception Already_running
+exception No_pidfile
+exception Cant_find_logger
+exception Problem_with_logger
+exception Invalid_pidfile
+exception No_proc_entry of string
 
 type daemon_state = Terminate | Respawn | MlnetDied | Nop
-;;
 
 type action_type = Start | Stop | Restart 
-;;
 
 let (prio_min,prio_max) = (-20,20)
-;;
 
 type mldonkey_server_state = {
   real_home : string option;
@@ -52,7 +49,6 @@
   inifiles : string list;
   passwdfiles : string list;
 }
-;;
 
 let user_home st =
   match st.real_home with 
@@ -60,7 +56,6 @@
     raise No_home_variable
   | Some x ->
     x
-;;
 
 let get_chdir st =
   match st.chdir with
@@ -70,7 +65,6 @@
     real_filename
   | Some x ->
     x
-;;
 
 let get_pidfile st =
   match st.pidfile with
@@ -80,7 +74,6 @@
     real_filename
   | Some x ->
     x
-;;
 
 let get_logfile st =
   match st.logfile with
@@ -90,15 +83,12 @@
     real_filename
   | Some x ->
     x
-;;
   
 let get_inifiles st =
   List.map (Filename.concat (get_chdir st)) st.inifiles
-;;
 
 let get_passwdfiles st =
   List.map (Filename.concat (get_chdir st)) st.passwdfiles
-;;
 
 let default_mldonkey_server_state = 
   {
@@ -158,7 +148,6 @@
       "users.ini"
     ];
   }
-;;
 
 let get_mldonkey_server_state () =
   let state = 
@@ -284,7 +273,6 @@
   "Usage mldonkey_server [options] -- [mlnet options] where options are:"
   in
   !state
-;;
 
 let print_log st str =
   if st.quiet then
@@ -304,7 +292,6 @@
     )
   else
     false
-;;
 
 let debug st str =
   if print_log st str then
@@ -314,7 +301,6 @@
       print_string str;
       print_newline ()
     )
-;;
 
 let warning st str = 
   if print_log st str then
@@ -324,20 +310,17 @@
       prerr_string str;
       prerr_newline ()
     )
-;;
 
 let fatal st str =
   prerr_string (" "^str);
   prerr_newline ();
   ignore (print_log st str)
-;;
 
 let go_home st =
   debug st ("Chdir to home dir: "^(user_home st));
   Unix.putenv "HOME" (user_home st);
   Unix.putenv "MLDONKEY_STRINGS" (Filename.concat (get_chdir st) "mlnet_strings");
   Sys.chdir (get_chdir st)
-;;
 
 let create_home st =
   if Sys.file_exists (get_chdir st) then
@@ -367,12 +350,10 @@
     ^", "^(string_of_int st.chgid)^")");
   setgid st.chgid;
   setuid st.chuid
-;;
 
 let set_umask st =
   debug st ("Set umask of the process: "^(string_of_int st.umask));
   ignore(umask st.umask)
-;;
 
 let set_nice st =
   debug st ("Set niceness of the process: "^(string_of_int st.nice));
@@ -389,7 +370,6 @@
   else
     warning st ("Niceness out of bound ("^(string_of_int st.nice)
     ^"not in ["^(string_of_int prio_min)^"; "^(string_of_int prio_max)^"])")
-;;
 
 (** Create a pidfile, holding the PID value of the process *)
 let create_pidfile st =
@@ -399,7 +379,6 @@
   output_string pidfile (string_of_int (Unix.getpid ()));
   output_string pidfile "\n";
   close_out pidfile
-;;
 
 (** Read a pidfile, return the PID value stored in it *)
 let read_pidfile st =
@@ -417,7 +396,6 @@
   | End_of_file 
   | Failure "int_of_string" ->
       raise Invalid_pidfile
-;;
 
 (** Remove a pidfile *)
 let close_pidfile st =
@@ -426,7 +404,6 @@
     Sys.remove (get_pidfile st)
   with Sys_error(_) ->
     raise No_pidfile
-;;
 
 (** Check that the given PID is a running instance of the program which we are
     in *)
@@ -467,7 +444,6 @@
         )
   else
     false
-;;
 
 (** Remove stale pidfile 
  *)
@@ -479,7 +455,6 @@
     )
   else
     ()
-;;
 
 (** Get problematic INI file for mldonkey. Returns a list of all problematic
     files 
@@ -495,7 +470,6 @@
       lst
   in
   List.fold_left check_one_tmp_ini_file [] lst_fl
-;;
 
 (** Check that user/group and perms are correctly sets for any 
     directory/file that could be used by mldonkey. Returns a list of all
@@ -534,7 +508,6 @@
       lst
   in
   List.fold_left check_one_file_owner_perms [] lst_fl
-;;
 
 (** Check that the given list of file are only readable by the owner/group. It 
     is used to check that the file containing password are not readable by the
@@ -555,7 +528,6 @@
       lst
   in
   List.fold_left check_one_file_security_perms [] lst_fl
-;;
 
 let sanity_check st = 
   (* Checker function: apply the given function on the given list. If the
@@ -621,9 +593,7 @@
     [Filename.concat (get_chdir st) "mlnet.pid"]
     "file[s] should no exist"
     "delete it first"
-    1;
-;;
-
+    1
 
 let stop_or_die st pid =
   let timeout = ref false
@@ -649,7 +619,6 @@
   end
   else
     debug st ("Process "^(string_of_int pid)^" terminated")
-;;
 
 let daemonize st = 
   if st.daemon then
@@ -687,7 +656,6 @@
     )
   else
     ()  
-;;
 
 let start_mldonkey_server st =
   sanity_check st;
@@ -860,8 +828,6 @@
   done;
   debug st "MLDonkey server end";
   close_pidfile st
-;;
-
 
 let kill_mldonkey_server st signal signal_name=
   if daemon_is_running st then
@@ -879,15 +845,12 @@
     end
   else
     debug st ("Daemon is not running")
-;;
     
 let stop_mldonkey_server st =
   kill_mldonkey_server st Sys.sigterm "SIGTERM"
-;;
 
 let restart_mldonkey_server st =
   kill_mldonkey_server st Sys.sighup "SIGHUP"
-;;
 
 let _ = 
   try
@@ -945,6 +908,3 @@
     end
 in
 exit 1
-;;
-
-




More information about the Pkg-ocaml-maint-commits mailing list