[arch-commits] Commit in tomcat7/trunk (3 files)

Guillaume Alaux guillaume at archlinux.org
Mon Feb 9 21:32:09 UTC 2015


    Date: Monday, February 9, 2015 @ 22:32:07
  Author: guillaume
Revision: 231203

User creation by systemd and fixes

Modified:
  tomcat7/trunk/PKGBUILD
  tomcat7/trunk/systemd_tmpfiles.d_tomcat7.conf
  tomcat7/trunk/tomcat7.install

---------------------------------+
 PKGBUILD                        |   13 ++++++++-----
 systemd_tmpfiles.d_tomcat7.conf |    8 +++++---
 tomcat7.install                 |   24 ++++--------------------
 3 files changed, 17 insertions(+), 28 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-02-09 21:27:41 UTC (rev 231202)
+++ PKGBUILD	2015-02-09 21:32:07 UTC (rev 231203)
@@ -1,7 +1,7 @@
 # Maintainer: Guillaume ALAUX <guillaume at archlinux.org>
 pkgname=tomcat7
 pkgver=7.0.57
-pkgrel=1
+pkgrel=2
 pkgdesc='Open source implementation of the Java Servlet 3.0 and JavaServer Pages 2.2 technologies'
 arch=('any')
 url='http://tomcat.apache.org/'
@@ -18,13 +18,13 @@
 install=${pkgname}.install
 source=(http://archive.apache.org/dist/tomcat/tomcat-7/v${pkgver}/bin/apache-tomcat-${pkgver}.tar.gz
         systemd_${pkgname}.service
-        systemd_tmpfiles.d_${pkgname}.conf
-        ${pkgname}.install)
+        systemd_sysusers.d_${pkgname}.conf
+        systemd_tmpfiles.d_${pkgname}.conf)
 
 sha256sums=('1ce390049ed23143e3db0c94781c1e88a4d1b39ceb471c0af088a0c326d637cb'
             'c6d4dbbaac417418397e395944f7b6aa38ac444410e2fc33c7ee3520dba4cd23'
-            '4bfeb2f4462547bf15cb2b72db545c0531c70f8640fa79344d520ceea6812a93'
-            '13df331dad3441f027c8b5964ba5bf420df3dc8faf0f96e071db981e8ea322f0')
+            '4c0e12c45b406d2e8f0081de3d60dbf34c31f4da36296cedce6af5d6e03c8708'
+            'bc8ce84b3b2c938f55980cbe9bc1c2a5f371e23b34cf11c1b56d2c49836761d6')
 
 _gid_log=19
 _gid_tomcat=71
@@ -61,6 +61,7 @@
   install -dm775 "${pkgdir}"/var/lib/${pkgname}
   cp -r webapps "${pkgdir}"/var/lib/${pkgname}
   chown -R ${_uid_tomcat}:${_gid_tomcat} "${pkgdir}"/var/lib/${pkgname}
+  chmod 775 "${pkgdir}"/var/lib/${pkgname}/webapps
   ln -s /var/lib/${pkgname}/webapps "${pkgdir}"/usr/share/${pkgname}/webapps
 
   install -dm1777 "${pkgdir}"/var/tmp
@@ -70,6 +71,8 @@
 
   install -Dm644 "${srcdir}"/systemd_${pkgname}.service \
                  "${pkgdir}"/usr/lib/systemd/system/${pkgname}.service
+  install -Dm644 "${srcdir}"/systemd_sysusers.d_${pkgname}.conf \
+                 "${pkgdir}"/usr/lib/sysusers.d/${pkgname}.conf
   install -Dm644 "${srcdir}"/systemd_tmpfiles.d_${pkgname}.conf \
                  "${pkgdir}"/usr/lib/tmpfiles.d/${pkgname}.conf
 }

Modified: systemd_tmpfiles.d_tomcat7.conf
===================================================================
--- systemd_tmpfiles.d_tomcat7.conf	2015-02-09 21:27:41 UTC (rev 231202)
+++ systemd_tmpfiles.d_tomcat7.conf	2015-02-09 21:32:07 UTC (rev 231203)
@@ -1,3 +1,5 @@
-d   /var/tmp/tomcat7
-d   /var/tmp/tomcat7/temp   0775    tomcat7  tomcat7
-d   /var/tmp/tomcat7/work   0775    tomcat7  tomcat7
+d  /var/tmp/tomcat7/temp     0775  tomcat7  tomcat7
+d  /var/tmp/tomcat7/work     0775  tomcat7  tomcat7
+d  /var/lib/tomcat7          0775  tomcat7  tomcat7
+d  /var/lib/tomcat7/webapps  0775  tomcat7  tomcat7
+d  /var/log/tomcat7          0775  tomcat7  log

Modified: tomcat7.install
===================================================================
--- tomcat7.install	2015-02-09 21:27:41 UTC (rev 231202)
+++ tomcat7.install	2015-02-09 21:32:07 UTC (rev 231203)
@@ -1,16 +1,6 @@
-_pkgname='tomcat7'
-_gid_tomcat_name='tomcat7'
-_gid_tomcat=71
-_uid_tomcat_name='tomcat7'
-_uid_tomcat=71
-
 post_install() {
-  if ! getent group ${_gid_tomcat_name} >/dev/null 2>&1; then
-    groupadd -g ${_gid_tomcat} ${_gid_tomcat_name}
-  fi
-  if ! getent passwd ${_uid_tomcat_name} >/dev/null 2>&1; then
-    useradd  -u ${_uid_tomcat} -g ${_gid_tomcat_name} -d /usr/share/${_pkgname} -s /bin/false ${_uid_tomcat_name}
-  fi
+    systemd-sysusers tomcat7.conf
+    systemd-tmpfiles --create tomcat7.conf
 
   if [ -f lib/modules/$(uname -r)/kernel/security/capability.ko ]; then
     echo 'It appears that your current kernel has linux security'
@@ -24,12 +14,6 @@
 }
 
 pre_remove() {
-  if getent passwd ${_uid_tomcat_name} > /dev/null 2>&1; then
-    userdel ${_uid_tomcat_name}
-  fi
-  if getent group ${_gid_tomcat_name} > /dev/null 2>&1; then
-    groupdel ${_gid_tomcat_name}
-  fi
-
-  echo "To fully clean Tomcat's file, consider removing directories /var/{lib,tmp,log}/${_pkgname}"
+  echo "Leftover files may reside in /var/{lib,tmp,log}/tomcat7"
+  echo "If you remove them, you may also want to remove user and group 'tomcat7'"
 }



More information about the arch-commits mailing list