summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVianney Bouchaud2023-01-03 11:20:42 +0100
committerVianney Bouchaud2023-01-03 11:20:42 +0100
commite65216abd196e5c5b3c6ff96566df7e862a76a6b (patch)
tree1c4592f6db2cd23fb645fdb465c5d0bf8b12163f
downloadaur-e65216abd196e5c5b3c6ff96566df7e862a76a6b.tar.gz
Initial upload: kured-sentinel 1.0.0-1
adding kured-sentinel
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD25
-rwxr-xr-xkured-sentinel9
-rw-r--r--kured-sentinel.hook10
4 files changed, 58 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c2ff4c711d28
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = kured-sentinel
+ pkgdesc = Pacman hook to create the sentinel file for kured.
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/vbouchaud/aur/tree/main/kured-sentinel
+ arch = any
+ license = MIT
+ depends = longoverdue
+ source = kured-sentinel
+ source = kured-sentinel.hook
+ sha256sums = c050b7b8b6bb244b16ad84c3d162b91ddbf9ebaeda423df7418e4ad646fe99b3
+ sha256sums = 9124af974ca641ff1421bc077ae6e4f7dae0704bf0ba7a7d6630d75afdbe1a06
+
+pkgname = kured-sentinel
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..216528a5d65f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,25 @@
+# Maintainer: Vianney Bouchaud <aur dot vianney at bouchaud dot org>
+
+pkgname=kured-sentinel
+pkgdesc="Pacman hook to create the sentinel file for kured."
+pkgver=1.0.0
+pkgrel=1
+arch=("any")
+url="https://github.com/vbouchaud/aur/tree/main/kured-sentinel"
+license=("MIT")
+depends=("longoverdue")
+
+sha256sums=(
+ c050b7b8b6bb244b16ad84c3d162b91ddbf9ebaeda423df7418e4ad646fe99b3
+ 9124af974ca641ff1421bc077ae6e4f7dae0704bf0ba7a7d6630d75afdbe1a06
+)
+
+source=(
+ kured-sentinel
+ kured-sentinel.hook
+)
+
+package() {
+ install -D -m0644 "${srcdir}/kured-sentinel.hook" "${pkgdir}/usr/share/libalpm/hooks/kured-sentinel.hook"
+ install -D -m0755 "${srcdir}/kured-sentinel" "${pkgdir}/usr/bin/kured-sentinel"
+}
diff --git a/kured-sentinel b/kured-sentinel
new file mode 100755
index 000000000000..0253e9bd2855
--- /dev/null
+++ b/kured-sentinel
@@ -0,0 +1,9 @@
+ #!/usr/bin/env bash
+
+explicitly_asked=$(longoverdue | grep -c "reboot required")
+critical_services_updated=$(longoverdue | grep -c "kubelet")
+kernel_updated=$(longoverdue | grep -c "running kernel")
+
+if (( $(( explicitly_asked + critical_services_updated + kernel_updated )) > 0 )); then
+ touch /var/run/reboot-required
+fi
diff --git a/kured-sentinel.hook b/kured-sentinel.hook
new file mode 100644
index 000000000000..43a8f0a0e8d3
--- /dev/null
+++ b/kured-sentinel.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Upgrade
+Type = File
+Target = usr/*
+
+[Action]
+Description = Adding reboot sentinel file if needed...
+Depends = longoverdue
+When = PostTransaction
+Exec = /usr/bin/sentinel