From 4708e5ad2215bce4806578c9417a09ceccef0292 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 18 Sep 2016 06:25:31 +0000 Subject: [PATCH 1/1] Rename internal:process to .mudpy.process 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 | 5 ++--- lib/mudpy/misc.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/etc/mudpy.yaml b/etc/mudpy.yaml index aaf3db7..672cf4f 100644 --- a/etc/mudpy.yaml +++ b/etc/mudpy.yaml @@ -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" diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 02f2fba..6c720d5 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -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) -- 2.11.0