[arch-commits] Commit in tomcat8/trunk (PKGBUILD tomcat8.install)

Guillaume Alaux guillaume at archlinux.org
Thu Feb 5 22:53:25 UTC 2015


    Date: Thursday, February 5, 2015 @ 23:53:25
  Author: guillaume
Revision: 230880

Handle user creation with systemd

Modified:
  tomcat8/trunk/PKGBUILD
  tomcat8/trunk/tomcat8.install

-----------------+
 PKGBUILD        |    6 +++++-
 tomcat8.install |   23 +++--------------------
 2 files changed, 8 insertions(+), 21 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-02-05 22:19:10 UTC (rev 230879)
+++ PKGBUILD	2015-02-05 22:53:25 UTC (rev 230880)
@@ -18,13 +18,15 @@
 install=${pkgname}.install
 source=(http://archive.apache.org/dist/tomcat/tomcat-8/v${pkgver}/bin/apache-tomcat-${pkgver}.tar.gz
         systemd_${pkgname}.service
+        systemd_sysusers.d_${pkgname}.conf
         systemd_tmpfiles.d_${pkgname}.conf
         ${pkgname}.install)
 
 sha256sums=('49f9097073493accb8f8e0827d8f4ee00d2cc115b9188fc3902deb3696554379'
             'd44056248b7cdd6671fd4de08a9453b3bd1a83980343d249a99b74939d46f4d4'
+            '3f69c07659509bd1ae9d94cecbbba7c9072f0ede69e0a69d05b67a66aef9f686'
             'cd637d5b1a0e816c149c868a72d3d315ea0061efc9e544cadfbc73859dedb847'
-            '32fcb0f44e32cd8901e936ebad4942a399efa8b98fdc42f5345dd8929b6c1887')
+            '812e658d541f82ec20cf6933816e144e469665ecbf0f65ad0b1864cc3ded129f')
 
 _gid_log=19
 _gid_tomcat=57
@@ -70,6 +72,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: tomcat8.install
===================================================================
--- tomcat8.install	2015-02-05 22:19:10 UTC (rev 230879)
+++ tomcat8.install	2015-02-05 22:53:25 UTC (rev 230880)
@@ -1,16 +1,5 @@
-_pkgname='tomcat8'
-_gid_tomcat_name='tomcat8'
-_gid_tomcat=57
-_uid_tomcat_name='tomcat8'
-_uid_tomcat=57
-
 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 tomcat8.conf
 
   if [ -f lib/modules/$(uname -r)/kernel/security/capability.ko ]; then
     echo 'It appears that your current kernel has linux security'
@@ -24,12 +13,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 exist in /var/{lib,tmp,log}/tomcat8"
+  echo "If you remove them, you may also want to remove user and group 'tomcat8'"
 }



More information about the arch-commits mailing list