Commits

Anonymous committed 0b58c33

0.12.3dev: `tracd` command reports the error when a pid file is not writable.

Closes #10310.

  • Participants
  • Parent commits 3342372
  • Branches 0.12-stable

Comments (0)

Files changed (1)

trac/util/daemon.py

                 if e.errno != errno.ESRCH:
                     raise
 
+        # The pid file must be writable
+        try:
+            fileobj = open(pidfile, 'r+')
+            fileobj.close()
+        except IOError, e:
+            from trac.util.text import exception_to_unicode
+            sys.exit('Error writing to pid file: %s' % exception_to_unicode(e))
+
     # Perform first fork
     pid = os.fork()
     if pid > 0: