$NetBSD: patch-ah,v 1.1.1.1 2007/12/18 15:35:28 taca Exp $ # set owner/group for Zone instance's some directories. --- utilities/mkzopeinstance.py.orig 2007-10-29 22:09:41.000000000 +0900 +++ utilities/mkzopeinstance.py @@ -32,8 +32,14 @@ import os import shutil import sys import copyzopeskel +import pwd +import grp def main(): + dirs = ['log', 'var'] + user = '@ZOPE_USER@' + group = '@ZOPE_GROUP@' + try: opts, args = getopt.getopt(sys.argv[1:], "hu:d:s:", @@ -124,6 +130,16 @@ def main(): copyzopeskel.copyskel(skelsrc, skeltarget, None, None, **kw) if user and password: write_inituser(inituser, user, password) + try: + u = pwd.getpwnam(user) + g = grp.getgrnam(group) + + for d in dirs: + p = os.path.join(instancehome, d) + os.chown(p, u.pw_uid, g.gr_gid) + except: + sys.exit(1) + def usage(stream, msg=None): if msg: