diff options
| author | bwarsaw | 2002-03-29 18:38:31 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-03-29 18:38:31 +0000 |
| commit | d5e8539aceb4e61fbdf6b81d7917fd7b9e7b0303 (patch) | |
| tree | 5bfac66934a4093bde4040927be1cf47906eb907 | |
| parent | 26467a1b3bc838753979abd17d7e29561414bc8e (diff) | |
| download | mailman-d5e8539aceb4e61fbdf6b81d7917fd7b9e7b0303.tar.gz mailman-d5e8539aceb4e61fbdf6b81d7917fd7b9e7b0303.tar.zst mailman-d5e8539aceb4e61fbdf6b81d7917fd7b9e7b0303.zip | |
main(): Write the master-qrunner.pid file with 660 permissions.
| -rw-r--r-- | bin/mailmanctl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/mailmanctl b/bin/mailmanctl index 673deb6f1..8d9b90750 100644 --- a/bin/mailmanctl +++ b/bin/mailmanctl @@ -365,10 +365,15 @@ def main(): return # child lock._take_possession() - # First, save our pid in a file for "mailmanctl stop" rendezvous - fp = open(mm_cfg.PIDFILE, 'w') - print >> fp, os.getpid() - fp.close() + # First, save our pid in a file for "mailmanctl stop" rendezvous. We + # want the perms on the .pid file to be rw-rw---- + omask = os.umask(6) + try: + fp = open(mm_cfg.PIDFILE, 'w') + print >> fp, os.getpid() + fp.close() + finally: + os.umask(omask) # Create a new session and become the session leader, but since we # won't be opening any terminal devices, don't do the ultra-paranoid # suggestion of doing a second fork after the setsid() call. |
