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

Daniel Micay thestinger at nymeria.archlinux.org
Mon Mar 24 21:35:18 UTC 2014


    Date: Monday, March 24, 2014 @ 22:35:18
  Author: thestinger
Revision: 108209

chrony: run as chrony user, not root

Added:
  chrony/trunk/chrony.install
Modified:
  chrony/trunk/PKGBUILD
  chrony/trunk/service

----------------+
 PKGBUILD       |    7 +++++--
 chrony.install |   18 ++++++++++++++++++
 service        |    2 +-
 3 files changed, 24 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-03-24 20:35:53 UTC (rev 108208)
+++ PKGBUILD	2014-03-24 21:35:18 UTC (rev 108209)
@@ -9,7 +9,7 @@
 
 pkgname=chrony
 pkgver=1.29.1
-pkgrel=1
+pkgrel=2
 pkgdesc='Lightweight NTP client and server'
 arch=('i686' 'x86_64')
 url="http://chrony.tuxfamily.org/"
@@ -19,8 +19,9 @@
 backup=('etc/chrony.conf')
 source=(http://download.tuxfamily.org/chrony/${pkgname}-${pkgver}.tar.gz
         service)
+install=${pkgname}.install
 sha256sums=('658c9bb4d8c8d8ec7d0908429aa266e5f8413ba86bd4acbfd2f9669f6065af27'
-            'bef4305fa7e5828e1a1fd43aa8e631f22f21902f6cdc2d3b5b41a57bd9a175dc')
+            '3c9d05aaba6c0bef43fd1923a6dd7ac5f9b9539d21efbd1fbe592b54dec8d493')
 
 build() {
   cd $pkgname-$pkgver
@@ -45,4 +46,6 @@
 
   install -dm755 "$pkgdir/usr/lib/systemd/ntp-units.d"
   echo "$pkgname.service" > "$pkgdir/usr/lib/systemd/ntp-units.d/$pkgname.list"
+
+  chown 183:183 "$pkgdir/var/lib/chrony"
 }

Added: chrony.install
===================================================================
--- chrony.install	                        (rev 0)
+++ chrony.install	2014-03-24 21:35:18 UTC (rev 108209)
@@ -0,0 +1,18 @@
+post_install() {
+  getent group chrony &>/dev/null || groupadd -g 183 chrony >/dev/null
+  getent passwd chrony &>/dev/null || useradd -u 183 -g chrony -d /var/lib/chrony -c 'Network Time Protocol' -s /bin/false chrony >/dev/null
+  true
+}
+
+post_upgrade() {
+  if [[ $(vercmp $2 1.29.1-2) -le 0 ]]; then
+    post_install
+    chown -R 183:183 /var/lib/chrony
+  fi
+}
+
+post_remove() {
+  getent passwd chrony &>/dev/null && userdel chrony >/dev/null
+  getent group chrony &>/dev/null && groupdel chrony >/dev/null
+  true
+}

Modified: service
===================================================================
--- service	2014-03-24 20:35:53 UTC (rev 108208)
+++ service	2014-03-24 21:35:18 UTC (rev 108209)
@@ -4,7 +4,7 @@
 
 [Service]
 Type=forking
-ExecStart=/usr/bin/chronyd
+ExecStart=/usr/bin/chronyd -u chrony
 PIDFile=/var/run/chronyd.pid
 
 [Install]




More information about the arch-commits mailing list