-from mudpy import log, on_pulse, reload_data, universe
+
+# a consistent list so we can reimport these on reload
+importlist = [
+ "create_pidfile",
+ "daemonize",
+ "log",
+ "on_pulse",
+ "reload_data",
+ "remove_pidfile",
+ "universe"
+ ]
+for item in importlist: exec("from mudpy import " + item)
+
+# log an initial message
+from sys import argv
+log("Started mudpy with command line: " + " ".join(argv))
+
+# fork and disassociate
+daemonize()
+
+# make the pidfile
+create_pidfile(universe)