summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-admin/zope-config/ChangeLog9
-rw-r--r--app-admin/zope-config/Manifest6
-rw-r--r--app-admin/zope-config/files/0.4/zope-config99
-rw-r--r--app-admin/zope-config/files/digest-zope-config-0.4-r30
-rw-r--r--app-admin/zope-config/zope-config-0.4-r3.ebuild36
5 files changed, 126 insertions, 24 deletions
diff --git a/app-admin/zope-config/ChangeLog b/app-admin/zope-config/ChangeLog
index 7718469f51b9..fe6e43a27c66 100644
--- a/app-admin/zope-config/ChangeLog
+++ b/app-admin/zope-config/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/zope-config
# Copyright 2003-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/ChangeLog,v 1.24 2004/09/11 20:38:48 lanius Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/ChangeLog,v 1.25 2004/09/18 15:58:05 batlogg Exp $
+
+*zope-config-0.4-r3 (18 Sep 2004)
+
+ 18 Sep 2004; Jodok Batlogg <batlogg@gentoo.org>; files/0.4/zope-config,
+ +zope-config-0.4-r3.ebuild:
+ let users define the user additionaly to the group under which the instance
+ should run. Thanks to Bernd Dorn for this.
*zope-config-0.4-r2 (11 Sep 2004)
diff --git a/app-admin/zope-config/Manifest b/app-admin/zope-config/Manifest
index f3f087e672a5..1b49dfa0ac2b 100644
--- a/app-admin/zope-config/Manifest
+++ b/app-admin/zope-config/Manifest
@@ -2,16 +2,18 @@ MD5 ca0dc280795eae4989394c65f42ff9ed zope-config-0.4-r2.ebuild 964
MD5 fb37e913fece40227de866c18b12c380 zope-config-0.3.ebuild 954
MD5 66364d21a70a8fb1b0a30f7831df514e zope-config-0.1-r1.ebuild 540
MD5 cbd41a7510c75bff07613a2250e54d48 zope-config-0.4-r1.ebuild 964
+MD5 e28bc0b73cfb16f06fb7d8d159f08287 zope-config-0.4-r3.ebuild 968
MD5 ce10dc2ab0139995d0a9f0a8bcdce9b1 zope-config-0.4.ebuild 955
-MD5 f77dbc36ec17d5d771add91b1f3b75ae ChangeLog 3689
+MD5 aa1f9566fa94dca1cc0168459c3568a7 ChangeLog 3953
MD5 7890d88c5c6d189fbe6b187a3ebb6532 metadata.xml 161
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.3 0
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.4 0
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.1-r1 0
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.4-r1 0
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.4-r2 0
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-zope-config-0.4-r3 0
MD5 0f40a729a7da468e26035bb6ee809497 files/0.1/zope-config 6878
MD5 ee33083be6a5df4425481f4212e94493 files/0.3/zope-config 7714
MD5 091fc2dce258d3da117b7c1017bd5b9a files/0.3/zope-config.conf 1040
-MD5 8b5d191baafefde533a71f3a9e96fc31 files/0.4/zope-config 12581
+MD5 da7fa62a10e32ecbf602577ed31f6138 files/0.4/zope-config 14204
MD5 a896b537030a8353798897a448a152ca files/0.4/zope-config.conf 1079
diff --git a/app-admin/zope-config/files/0.4/zope-config b/app-admin/zope-config/files/0.4/zope-config
index 348d99cac072..5dfcbb3c4572 100644
--- a/app-admin/zope-config/files/0.4/zope-config
+++ b/app-admin/zope-config/files/0.4/zope-config
@@ -9,7 +9,7 @@
#
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.4/zope-config,v 1.5 2004/09/11 20:38:48 lanius Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.4/zope-config,v 1.6 2004/09/18 15:58:05 batlogg Exp $
#
#
# Notes:
@@ -21,11 +21,14 @@ VERSION="0.4"
CONFIGFILE=/etc/zope-config.conf
if [ -e ${CONFIGFILE} ]; then
source ${CONFIGFILE}
+ EVENTLOGDIR=`dirname ${EVENTLOGDIR}`/`basename ${EVENTLOGDIR}`
else
echo "Unable to find config file: ${CONFIGFILE}" 1>&2
exit 1
fi
+
+
# Return codes used in this program:
E_SUCCESS=0
E_FAILURE=1
@@ -34,19 +37,25 @@ E_ZILIST=22
E_PARAM=26
E_ZSLIST=28
E_ZIDEFAULT=30
-
+ZUID=''
#Parameters:
# $1 = instance directory
# $2 = group
+# $3 = user
zinst_security_setup()
{
if [ ${ZOPE27} ] ; then
- chown -R root:${2} ${1}
+ chown -R ${3}:${2} ${1}
chmod -R o-rwx ${1}
- chmod g+ws ${1}/{var,log}
+ chmod -R g-w ${1}
+ #chmod g+ws ${1}/{var,log}
chmod g+rX -R ${1}
+ #set owner and group on log dir
+ chown -R ${ZUID}:${ZGID_NAME} ${EVENTLOGDIR}/${ZIRC_NAME}
+ # permissions on log dir
+ chmod -R 750 ${EVENTLOGDIR}/${ZIRC_NAME}
else
- chown -R ${ZUID}:${2} ${1}
+ chown -R ${3}:${2} ${1}
chmod -R g+u ${1}
chmod -R o-rwx ${1}
chown root ${1}/var/ # needed if $ZOPE_OPTS='-u root'
@@ -86,6 +95,12 @@ zinst_fs_setup()
else
${BIN}/mkzopeinstance.py --dir $2
fi
+ # create the log directory
+ mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
+ # remove log directory in skeltarget
+ rm -r $2/log
+ # symlink log directory
+ ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
RESULT=$?
else
if [ $NEWZOPE = 1 ] ; then
@@ -163,8 +178,8 @@ zinst_rc_setup()
RESULT=${E_PARAM}
elif [ ${ZOPE27} ] ; then
install $1/skel/zope.initd ${INITD}/${3}
- echo "INSTANCE_HOME=${2}" >${CONFD}/$3
- echo "EVENT_LOG_FILE=${EVENTLOGDIR}/${3}" >>${CONFD}/$3
+ #echo "INSTANCE_HOME=${2}" >${CONFD}/$3
+ #echo "EVENT_LOG_FILE=${EVENTLOGDIR}/${3}" >>${CONFD}/$3
sed -i \
-e "/^# *effective-user/ a\\effective-user ${ZUID}\\ " \
${2}/etc/zope.conf
@@ -344,6 +359,32 @@ zinst_zgid_set()
return ${RESULT}
}
+# Gets a name for the user that owns the new zinstance and also creates the
+# group if nessicary, this is the user zope runs as
+zinst_zuid_set()
+{
+ local RESULT=
+ while : ; do
+ ZUID=$(dialog --stdout \
+ --backtitle "We need to create and/or assign a zinstance user name." \
+ --inputbox "Enter a user name:" \
+ 0 0 $(basename ${ZIRC_NAME}))
+ RESULT=$?
+ if [ ${RESULT} -ne 0 ] ; then
+ break
+ elif [ -z ${ZUID} ] ; then
+ dialog --msgbox "Error: empty string." 0 0
+ continue
+ elif egrep "^${ZUID}:" /etc/passwd >/dev/null 2>&1 ; then
+ dialog --yesno "The user ${ZUID} already exists. Do you want to use it?" 0 0
+ RESULT=$?
+ [ ${RESULT} -ne 0 ] && continue
+ fi
+ break
+ done
+ return ${RESULT}
+}
+
# Sets the inituser password for a given zinstance
zinst_zpasswd_set()
{
@@ -405,16 +446,17 @@ while [ "$#" -gt 0 ] ; do
esac
case "$1" in
- --zserv=*) ZSERV_DIR=${OPTARG} ; zserv_version_detect ;;
- --zinst=*) ZINST_DIR=${OPTARG} ;;
- --zgid=*) ZGID_NAME=${OPTARG} ;;
- --zinituser) ZINIT_USER=inituser ;;
- --zidef-set) zinst_default_set ; exit $? ;;
- --zidef-get) zinst_default_get ; exit $? ;;
- --zpasswd) zinst_zpasswd_set ; exit $? ;;
- --version) echo ${VERSION} ; exit 0 ;;
- -*) usage ; exit 0 ;;
- *) usage ; exit 0 ;;
+ --zserv=*) ZSERV_DIR=${OPTARG} ; zserv_version_detect ;;
+ --zinst=*) ZINST_DIR=${OPTARG} ;;
+ --zgid=*) ZGID_NAME=${OPTARG} ;;
+ --zuid=*) ZUID=${OPTARG} ;;
+ --zinituser) ZINIT_USER=inituser ;;
+ --zidef-set) zinst_default_set ; exit $? ;;
+ --zidef-get) zinst_default_get ; exit $? ;;
+ --zpasswd) zinst_zpasswd_set ; exit $? ;;
+ --version) echo ${VERSION} ; exit 0 ;;
+ -*) usage ; exit 0 ;;
+ *) usage ; exit 0 ;;
esac
shift
done
@@ -423,29 +465,44 @@ done
if [ -z ${ZSERV_DIR} ] ; then
zserv_dir_get || { echo 'Cancelled: zserv_dir_get' ; exit 1 ; }
zserv_version_detect
+else
+ ZSERV_DIR=`dirname ${ZSERV_DIR}`/`basename ${ZSERV_DIR}`
fi
# if ZINST_DIR passed by command line, call zinst_dir_set to set it
if [ -z ${ZINST_DIR} ] ; then
zinst_dir_set || { echo 'Cancelled: zinst_dir_set' ; exit 1 ; }
+else
+ ZINST_DIR=`dirname ${ZINST_DIR}`/`basename ${ZINST_DIR}`
fi
# if ZIRC_NAME isn't set then use the base of the ZINST_DIR for ZIRC_NAME
[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR})
+if [ -z ${ZUID} ] ; then
+ zinst_zuid_set || { echo 'Cancelled: zinst_zuid_set' ; exit 1 ; }
+fi
+
if [ -z ${ZGID_NAME} ] ; then
zinst_zgid_set || { echo 'Cancelled: zinst_zgid_set' ; exit 1 ; }
fi
+
+
+
zserv_is_2.7_or_newer ${ZSERV_DIR}
+! groupmod ${ZGID_NAME} >/dev/null 2>&1 && groupadd ${ZGID_NAME}
zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZINIT_USER}
zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME}
-! groupmod ${ZGID_NAME} >/dev/null 2>&1 && groupadd ${ZGID_NAME}
-# add existing user zope to the new group
-gpasswd -a zope ${ZGID_NAME}
+# create user if needed
+useradd -g ${ZGID_NAME} ${ZUID}
+
+
+# add existing user to the new group
+gpasswd -a ${ZUID} ${ZGID_NAME}
-zinst_security_setup ${ZINST_DIR} ${ZGID_NAME}
+zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} ${ZUID}
# TODO: see about adding interactive configuration of ZOPE_OPTS
if [ ${ZOPE27} ] ; then
echo "Note: Review settings in ${ZINST_DIR}/etc/zope.conf."
diff --git a/app-admin/zope-config/files/digest-zope-config-0.4-r3 b/app-admin/zope-config/files/digest-zope-config-0.4-r3
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/app-admin/zope-config/files/digest-zope-config-0.4-r3
diff --git a/app-admin/zope-config/zope-config-0.4-r3.ebuild b/app-admin/zope-config/zope-config-0.4-r3.ebuild
new file mode 100644
index 000000000000..eb4814c17546
--- /dev/null
+++ b/app-admin/zope-config/zope-config-0.4-r3.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.4-r3.ebuild,v 1.1 2004/09/18 15:58:05 batlogg Exp $
+
+DESCRIPTION="A Gentoo Zope multi-Instance configure tool"
+SRC_URI=""
+HOMEPAGE="http://www.gentoo.org/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64"
+IUSE=""
+DEPEND=""
+RDEPEND=">=dev-util/dialog-0.7
+ sys-apps/grep
+ sys-apps/sed
+ sys-apps/shadow
+ dev-lang/python
+ sys-apps/coreutils"
+
+PDEPEND=">=net-zope/zope-2.7.2-r2"
+
+src_install() {
+ # the script
+ dosbin ${FILESDIR}/${PV}/zope-config
+ # config file
+ insinto /etc
+ doins ${FILESDIR}/${PV}/zope-config.conf
+ # ensure this directory exists
+ keepdir /var/log/zope
+}
+
+pkg_postinst() {
+ source ${FILESDIR}/${PV}/zope-config.conf
+ einfo "Please note that new instances now log into ${EVENTLOGDIR}"
+ einfo "Please see the configuration file /etc/zope-config.conf"
+}