diff options
author | crees <crees@FreeBSD.org> | 2012-02-02 04:53:01 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2012-02-02 04:53:01 +0800 |
commit | dafb17e13e3a4334b06443ff944a031fddaf9029 (patch) | |
tree | 4c6515d734a8b924f6fb4fb4f3a63c307e1bf1de /sysutils | |
parent | 91257dac919171245c0e2f7142e50c6764c5d6a8 (diff) | |
download | freebsd-ports-gnome-dafb17e13e3a4334b06443ff944a031fddaf9029.tar.gz freebsd-ports-gnome-dafb17e13e3a4334b06443ff944a031fddaf9029.tar.zst freebsd-ports-gnome-dafb17e13e3a4334b06443ff944a031fddaf9029.zip |
Use USERS and GROUPS
PR: ports/164548
Submitted by: crees (me)
Approved by: v.haisman@sh.cvut.cz (maintainer)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/bacula2-server/Makefile | 4 | ||||
-rw-r--r-- | sysutils/bacula2-server/pkg-deinstall.client | 6 | ||||
-rw-r--r-- | sysutils/bacula2-server/pkg-deinstall.server | 7 | ||||
-rw-r--r-- | sysutils/bacula2-server/pkg-install.client | 27 | ||||
-rw-r--r-- | sysutils/bacula2-server/pkg-install.server | 46 |
5 files changed, 3 insertions, 87 deletions
diff --git a/sysutils/bacula2-server/Makefile b/sysutils/bacula2-server/Makefile index db52dabf1066..e301d7388863 100644 --- a/sysutils/bacula2-server/Makefile +++ b/sysutils/bacula2-server/Makefile @@ -26,6 +26,9 @@ UNIQUENAME?= ${PORTNAME}${PKGNAMESUFFIX} WRKSRC= ${WRKDIR}/bacula-${DISTVERSION} +USERS= bacula +GROUPS= ${USERS} + .if !defined(WITH_BAT) .if !defined(WITH_CLIENT_ONLY) USE_RC_SUBR?= bacula-dir bacula-sd @@ -155,7 +158,6 @@ USE_MYSQL= yes DBTYPE= mysql SUB_LIST+= REQ_MYSQL=mysql REQ_PGSQL="" .elif defined(WITH_POSTGRESQL) -DEFAULT_PGSQL_VER?= 82 USE_PGSQL= yes CONFIGURE_ARGS+= --with-postgresql=yes DBTYPE= postgresql diff --git a/sysutils/bacula2-server/pkg-deinstall.client b/sysutils/bacula2-server/pkg-deinstall.client index 206ec9efca6b..4920be83b61e 100644 --- a/sysutils/bacula2-server/pkg-deinstall.client +++ b/sysutils/bacula2-server/pkg-deinstall.client @@ -21,11 +21,5 @@ case "$2" in echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" fi - # Note how to delete UID/GID - USER=bacula - GROUP=${USER} - if pw groupshow "${USER}" 2>/dev/null 1>&2; then - echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'" - fi ;; esac diff --git a/sysutils/bacula2-server/pkg-deinstall.server b/sysutils/bacula2-server/pkg-deinstall.server index 3af061509188..4920be83b61e 100644 --- a/sysutils/bacula2-server/pkg-deinstall.server +++ b/sysutils/bacula2-server/pkg-deinstall.server @@ -21,12 +21,5 @@ case "$2" in echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port" fi - # Note how to delete UID/GID - USER=bacula - GROUP=${USER} - if pw usershow "${USER}" 2>/dev/null 1>&2; then - echo "To delete Bacula user permanently, use 'pw userdel ${USER}'" - echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'" - fi ;; esac diff --git a/sysutils/bacula2-server/pkg-install.client b/sysutils/bacula2-server/pkg-install.client index 656acca83733..b4f5939ed9d3 100644 --- a/sysutils/bacula2-server/pkg-install.client +++ b/sysutils/bacula2-server/pkg-install.client @@ -14,30 +14,3 @@ bacula-fd 9102/tcp #Bacula file daemon bacula-sd 9103/tcp #Bacula storage daemon # Bacule port end" >> /etc/services fi - -case $2 in -PRE-INSTALL) - # Install UID/GID - USER=bacula - GROUP=${USER} - UID=910 - GID=${UID} - - if [ ! -d ${BACULA_DIR} ]; then - mkdir -p ${BACULA_DIR} - fi - - if pw group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - chgrp -R ${GROUP} ${BACULA_DIR} - ;; -esac diff --git a/sysutils/bacula2-server/pkg-install.server b/sysutils/bacula2-server/pkg-install.server index 1dc3d8613ada..b4f5939ed9d3 100644 --- a/sysutils/bacula2-server/pkg-install.server +++ b/sysutils/bacula2-server/pkg-install.server @@ -14,49 +14,3 @@ bacula-fd 9102/tcp #Bacula file daemon bacula-sd 9103/tcp #Bacula storage daemon # Bacule port end" >> /etc/services fi - -case $2 in -PRE-INSTALL) - # Install UID/GID - USER=bacula - GROUP=${USER} - UID=910 - GID=${UID} - - if [ ! -d ${BACULA_DIR} ]; then - mkdir -p ${BACULA_DIR} - fi - - if pw group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - if pw usermod ${USER} -d ${BACULA_DIR} -G operator - then - echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\"" - else - echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..." - exit 1 - fi - else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \ - -d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - chown -R ${USER}:${GROUP} ${BACULA_DIR} - ;; -esac |