Author: johannes
Date: 2006-02-06 10:34:19 -0600 (Mon, 06 Feb 2006)
New Revision: 8152
Modified:
trunk/gnue-common/src/apps/GServerApp.py
Log:
Create directory for pidfile if necessary
Modified: trunk/gnue-common/src/apps/GServerApp.py
===================================================================
--- trunk/gnue-common/src/apps/GServerApp.py 2006-02-06 13:57:57 UTC (rev
8151)
+++ trunk/gnue-common/src/apps/GServerApp.py 2006-02-06 16:34:19 UTC (rev
8152)
@@ -66,7 +66,7 @@
GBaseApp.__init__(self, connections, application, defaults)
if not self.OPTIONS ['foreground']:
- if os.name == 'posix':
+ if os.name == 'posix':
self.__removeStaleFile ()
self.__createPidFile (0)
@@ -181,6 +181,10 @@
@param pid: Process id to store in the pid file
"""
+ piddir = os.path.dirname (self.OPTIONS ['pidfile'])
+ if not os.path.exists (piddir):
+ os.makedirs (piddir)
+
pidfile = open (self.OPTIONS ['pidfile'], 'w')
pidfile.write ("%s%s" % (pid, os.linesep))
pidfile.close ()
_______________________________________________
Commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue