Date: Wednesday, March 7, 2018 @ 23:45:58
  Author: heftig
Revision: 318012

More hooks

Added:
  systemd/trunk/systemd-binfmt.hook
  systemd/trunk/systemd-catalog.hook
  systemd/trunk/systemd-daemon-reload.hook
  systemd/trunk/systemd-hook
  systemd/trunk/systemd-sysctl.hook
  systemd/trunk/systemd-udev-reload.hook
Modified:
  systemd/trunk/PKGBUILD
  systemd/trunk/systemd-hwdb.hook
  systemd/trunk/systemd-sysusers.hook
  systemd/trunk/systemd-tmpfiles.hook
  systemd/trunk/systemd-update.hook

----------------------------+
 PKGBUILD                   |   21 +++++++++++++++++----
 systemd-binfmt.hook        |   11 +++++++++++
 systemd-catalog.hook       |   11 +++++++++++
 systemd-daemon-reload.hook |   11 +++++++++++
 systemd-hook               |   31 +++++++++++++++++++++++++++++++
 systemd-hwdb.hook          |    2 +-
 systemd-sysctl.hook        |   11 +++++++++++
 systemd-sysusers.hook      |    4 ++--
 systemd-tmpfiles.hook      |    2 +-
 systemd-udev-reload.hook   |   11 +++++++++++
 systemd-update.hook        |    2 +-
 11 files changed, 108 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-03-07 23:45:55 UTC (rev 318011)
+++ PKGBUILD    2018-03-07 23:45:58 UTC (rev 318012)
@@ -30,9 +30,15 @@
         'loader.conf'
         'splash-arch.bmp'
         'systemd-user.pam'
+        'systemd-hook'
+        'systemd-binfmt.hook'
+        'systemd-catalog.hook'
+        'systemd-daemon-reload.hook'
         'systemd-hwdb.hook'
+        'systemd-sysctl.hook'
         'systemd-sysusers.hook'
         'systemd-tmpfiles.hook'
+        'systemd-udev-reload.hook'
         'systemd-update.hook')
 sha512sums=('SKIP'
             'SKIP'
@@ -43,10 +49,16 @@
             
'c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5'
             
'5a1d78b5170da5abe3d18fdf9f2c3a4d78f15ba7d1ee9ec2708c4c9c2e28973469bc19386f70b3cf32ffafbe4fcc4303e5ebbd6d5187a1df3314ae0965b25e75'
             
'b90c99d768dc2a4f020ba854edf45ccf1b86a09d2f66e475de21fe589ff7e32c33ef4aa0876d7f1864491488fd7edb2682fc0d68e83a6d4890a0778dc2d6fe19'
-            
'2c1f765e7cefc50f07ad994634ea25d9396e6b9c0de46e58f18377e642a471517a0dbf5eb547070a38c6ecf84ec8e030f650a6cee010871cd7a466a32534adda'
-            
'7d49a948f5d58f662a7d81544254528257ef8c0a08ca560834f09a7cdf566161d2df4d419ebbc2983196cd45c9eeefcd0c4c2c554376916dce42e895262afc30'
-            
'e521d92674597f82d589b83c378c50c92c881fdb84c436c8b26f7a3436a4c91a20585824a5563933f6868a3023b9ee2fdc7bd58e04bb47c25a0a36e296308fd3'
-            
'10190fba9f39a8f4b620a0829e0ba8ed63bb4dbeca712966011ee7807880d01ab2abff1a80baafeb6674db70526a473fe585db8190e864f318fc4d6068552618')
+            
'370d8c0fafc229607e968b884bbbcef426bef51fd0599bfca60717ffb6090e6206e90ca05f2cba835248ddb1f66c938f85515efc518cd24fb8d3ccc8bca4e065'
+            
'46f93725bc94381300535737fd0186a3c096fa83661179eab0c450c7b164a87d9a5dd9abcf6ae98bdeb4bf50a4ba4f1944769948c236e4814f166ff03b0ee177'
+            
'4cff2ebd962e26e2f516d8b4ac45c839dbfa54dd0588b423c224a328b9f7c62306ca7b2f6cb55240c564caf9972d5bcd2e0efaf2de49d64729aeb3bc1560c9eb'
+            
'872de70325e9798f0b5a77e991c85bd2ab6de24d9b9ba4e35002d2dd5df15f8b30739a0042a624776177ffc14a838cde7ee98622016ed41df3efda9a659730b2'
+            
'471342b8d0e05533908cda5d6a906050a51e3181beda1239e91d717029ee40a9eaed714996a445417d87c4e31b7f8522a665de176077fe0536d538369594996d'
+            
'3b11e8956169e6d80eca6e6de1b3e42641454d9d7be48961d400754f2242077d69fb7bfbeb0904f35ce569511036a7c9614a4a1cc3096fba993f46ae65e02895'
+            
'bf3225011760695040e9f7be2560348e68e86eac0295f5a17a6f7e3dda7ad7c008812a15904e2071b53d5f8048891602c8a9a18608ac64930f2d8cc4fac2a319'
+            
'ff1429a7c88e21d578c25d07e8cd9568577feb5a940fe39a7a815cf8431c57ca951ac6b394c53d2cdeb4efc645572c0b1b670a48cafcc405db41a6602b548e35'
+            
'e4a9d7607fe93daf1d45270971c8d8455c4bfc2c0bea8bcad05aeb89847edee23cd1a41073a72042622acf417018fe254f5bfc137604fe2c71292680bf67a1c2'
+            
'209b01b044877cc986757fa4009a92ea98f480306c2530075d153203c3cd2b3afccab6aacc1453dee8857991e04270572f1700310705d7a0f4d5bed27fab8c67')
 
 _backports=(
 )
@@ -222,6 +234,7 @@
   install -Dm644 splash-arch.bmp 
"$pkgdir"/usr/share/systemd/bootctl/splash-arch.bmp
 
   # pacman hooks
+  install -Dm755 systemd-hook "$pkgdir"/usr/share/libalpm/scripts/systemd-hook
   install -Dm644 -t "$pkgdir"/usr/share/libalpm/hooks *.hook
 
   # overwrite the systemd-user PAM configuration with our own

Added: systemd-binfmt.hook
===================================================================
--- systemd-binfmt.hook                         (rev 0)
+++ systemd-binfmt.hook 2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Target = usr/lib/binfmt.d/*.conf
+
+[Action]
+Description = Registering binary formats...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/systemd-hook binfmt
+NeedsTargets

Added: systemd-catalog.hook
===================================================================
--- systemd-catalog.hook                                (rev 0)
+++ systemd-catalog.hook        2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/systemd/catalog/*
+
+[Action]
+Description = Updating journal message catalog...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/systemd-hook catalog

Added: systemd-daemon-reload.hook
===================================================================
--- systemd-daemon-reload.hook                          (rev 0)
+++ systemd-daemon-reload.hook  2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/systemd/system/*
+
+[Action]
+Description = Reloading system manager configuration...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/systemd-hook daemon-reload

Added: systemd-hook
===================================================================
--- systemd-hook                                (rev 0)
+++ systemd-hook        2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+only_live() {
+  if [ ! -d /run/systemd/system ]; then
+    echo >&2 "  Skipped: Current root is not booted."
+    exit 0
+  fi
+}
+
+each_conf() {
+  while read -r f; do
+    "$@" "$(basename "$f")"
+  done
+}
+
+case $1 in
+  catalog)  /usr/bin/journalctl --update-catalog ;;
+  hwdb)     /usr/bin/systemd-hwdb --usr update ;;
+  update)   touch -c /usr ;;
+  sysusers) each_conf /usr/bin/systemd-sysusers ;;
+  tmpfiles) each_conf /usr/bin/systemd-tmpfiles --create ;;
+
+  daemon-reload) only_live; /usr/bin/systemctl daemon-reload ;;
+  udev-reload)   only_live; /usr/bin/udevadm control --reload ;;
+  binfmt)        only_live; each_conf /usr/lib/systemd/systemd-binfmt ;;
+  sysctl)        only_live; each_conf /usr/lib/systemd/systemd-sysctl ;;
+
+  *) echo >&2 "  Invalid operation '$1'"; exit 1 ;;
+esac
+
+exit 0

Modified: systemd-hwdb.hook
===================================================================
--- systemd-hwdb.hook   2018-03-07 23:45:55 UTC (rev 318011)
+++ systemd-hwdb.hook   2018-03-07 23:45:58 UTC (rev 318012)
@@ -8,4 +8,4 @@
 [Action]
 Description = Updating udev hardware database...
 When = PostTransaction
-Exec = /usr/bin/systemd-hwdb --usr update
+Exec = /usr/share/libalpm/scripts/systemd-hook hwdb

Added: systemd-sysctl.hook
===================================================================
--- systemd-sysctl.hook                         (rev 0)
+++ systemd-sysctl.hook 2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Target = usr/lib/sysctl.d/*.conf
+
+[Action]
+Description = Applying kernel sysctl settings...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/systemd-hook sysctl
+NeedsTargets

Modified: systemd-sysusers.hook
===================================================================
--- systemd-sysusers.hook       2018-03-07 23:45:55 UTC (rev 318011)
+++ systemd-sysusers.hook       2018-03-07 23:45:58 UTC (rev 318012)
@@ -5,7 +5,7 @@
 Target = usr/lib/sysusers.d/*.conf
 
 [Action]
-Description = Updating system user accounts...
+Description = Creating system user accounts...
 When = PostTransaction
-Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-sysusers "$(basename 
"$f")" ; done'
+Exec = /usr/share/libalpm/scripts/systemd-hook sysusers
 NeedsTargets

Modified: systemd-tmpfiles.hook
===================================================================
--- systemd-tmpfiles.hook       2018-03-07 23:45:55 UTC (rev 318011)
+++ systemd-tmpfiles.hook       2018-03-07 23:45:58 UTC (rev 318012)
@@ -7,5 +7,5 @@
 [Action]
 Description = Creating temporary files...
 When = PostTransaction
-Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-tmpfiles --create 
"$(basename "$f")"; done'
+Exec = /usr/share/libalpm/scripts/systemd-hook tmpfiles
 NeedsTargets

Added: systemd-udev-reload.hook
===================================================================
--- systemd-udev-reload.hook                            (rev 0)
+++ systemd-udev-reload.hook    2018-03-07 23:45:58 UTC (rev 318012)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/udev/rules.d/*
+
+[Action]
+Description = Reloading device manager configuration...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/systemd-hook udev-reload

Modified: systemd-update.hook
===================================================================
--- systemd-update.hook 2018-03-07 23:45:55 UTC (rev 318011)
+++ systemd-update.hook 2018-03-07 23:45:58 UTC (rev 318012)
@@ -8,4 +8,4 @@
 [Action]
 Description = Arming ConditionNeedsUpdate...
 When = PostTransaction
-Exec = /usr/bin/touch -c /usr
+Exec = /usr/share/libalpm/scripts/systemd-hook update

Reply via email to