[Blends-commit] [SCM] website branch, master, updated. 470253eb0475c946bd68c7b3c387ee7cc124eb20
Andreas Tille
tille at debian.org
Thu Sep 19 12:27:50 UTC 2013
The following commit has been merged in the master branch:
commit 470253eb0475c946bd68c7b3c387ee7cc124eb20
Author: Andreas Tille <tille at debian.org>
Date: Thu Sep 19 14:31:42 2013 +0200
Make sure anybody in group blends can deal with lockfile
diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index b4599dd..afe09af 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -21,6 +21,8 @@ DEFAULTPORT=5432
from sys import stderr, exit
from subprocess import Popen, PIPE
import os
+import grp
+import stat
import urllib
import StringIO
import gzip
@@ -233,6 +235,14 @@ def LockBlendsTools():
lf = open(LOCKFILE, 'w')
print >>lf, pid
lf.close()
+ try:
+ blendsgid = grp.getgrnam("blends").gr_gid
+ os.chown(LOCKFILE, -1, blendsgid)
+ os.chmod(LOCKFILE, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH )
+ # os.system("ls -l %s" % LOCKFILE)
+ except KeyError:
+ # if groups 'blends' does not exist on the machine we are simply testing and setting group permissions is not needed
+ pass
def UnlockBlendsTools():
"""Unlock previousely locked file"""
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list