Rename internal:process to .mudpy.process
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 18 Sep 2016 06:25:31 +0000 (06:25 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sun, 18 Sep 2016 06:25:31 +0000 (06:25 +0000)
Convert the old style internal:process element to a new style
.mudpy.process element and adjust the daemonize(), create_pidfile()
and remove_pidfile() functions accordingly.

etc/mudpy.yaml
lib/mudpy/misc.py

index aaf3db7..672cf4f 100644 (file)
@@ -45,9 +45,8 @@ __control__:
 .mudpy.network.host: '::1'
 .mudpy.network.port: 6669
 
-internal:process:
-    #daemon: yes
-    #pidfile: mudpy.pid
+#.mudpy.process.daemon: true
+#.mudpy.process.pidfile: mudpy.pid
 
 internal:storage:
     default_dir: "data"
index 02f2fba..6c720d5 100644 (file)
@@ -2312,7 +2312,7 @@ def daemonize(universe):
     """Fork and disassociate from everything."""
 
     # only if this is what we're configured to do
-    if universe.contents["internal:process"].get("daemon"):
+    if universe.contents["mudpy.process"].get("daemon"):
 
         # log before we start forking around, so the terminal gets the message
         log("Disassociating from the controlling terminal.")
@@ -2349,7 +2349,7 @@ def create_pidfile(universe):
     """Write a file containing the current process ID."""
     pid = str(os.getpid())
     log("Process ID: " + pid)
-    file_name = universe.contents["internal:process"].get("pidfile")
+    file_name = universe.contents["mudpy.process"].get("pidfile")
     if file_name:
         if not os.path.isabs(file_name):
             file_name = os.path.join(universe.startdir, file_name)
@@ -2361,7 +2361,7 @@ def create_pidfile(universe):
 
 def remove_pidfile(universe):
     """Remove the file containing the current process ID."""
-    file_name = universe.contents["internal:process"].get("pidfile")
+    file_name = universe.contents["mudpy.process"].get("pidfile")
     if file_name:
         if not os.path.isabs(file_name):
             file_name = os.path.join(universe.startdir, file_name)