summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nonsystemd/openrc/30-openrc-upgrade.hook4
-rw-r--r--nonsystemd/openrc/PKGBUILD6
-rw-r--r--nonsystemd/openrc/openrc-hook15
3 files changed, 19 insertions, 6 deletions
diff --git a/nonsystemd/openrc/30-openrc-upgrade.hook b/nonsystemd/openrc/30-openrc-upgrade.hook
index 10590e704..5cf05e800 100644
--- a/nonsystemd/openrc/30-openrc-upgrade.hook
+++ b/nonsystemd/openrc/30-openrc-upgrade.hook
@@ -1,7 +1,7 @@
[Trigger]
-Type = Package
+Type = Path
Operation = Upgrade
-Target = openrc
+Target = usr/bin/init
[Action]
Description = Reexecuting init ...
diff --git a/nonsystemd/openrc/PKGBUILD b/nonsystemd/openrc/PKGBUILD
index 8803954ba..a2a5c4864 100644
--- a/nonsystemd/openrc/PKGBUILD
+++ b/nonsystemd/openrc/PKGBUILD
@@ -12,7 +12,7 @@ pkgbase=openrc
pkgname=('openrc' 'openrc-bash-completions' 'openrc-zsh-completions'
'openrc-init' 'openrc-sysvinit')
pkgver=0.42.1
-pkgrel=2
+pkgrel=3
pkgdesc="Gentoo's universal init system"
arch=('x86_64' 'i686' 'armv7h')
url="http://www.gentoo.org/proj/en/base/openrc/"
@@ -34,8 +34,8 @@ source=("${pkgbase}-${pkgver}.tar.gz::${_url}/${pkgver}.tar.gz"
'binfmt-sh.patch')
sha256sums=('91a01ca6d930a0688fb91338209985de57cac7aa2d37feddacb78fd3d95308e2'
'0b44210db9770588bd491cd6c0ac9412d99124c6be4c9d3f7d31ec8746072f5c'
- '6eaabc9dc1bdfa05677473aa5f0643c2079849be51bf0dee36e0906702cffebe'
- '3ef8682540a038c239c4e07881cb084501d7996df2e0395b70a0a3953c7d00b2'
+ '624160cf29103f4df50c4764c246fe1eda6845f6307767ee1e1c90724336f41b'
+ 'a3fda2186e023ae60c0e0d3806ffeb95effe675acea03cdfd0bf30e8f1c188d4'
'cb5bc649c2c9998300aff1e9862a9404b44e53178d153d68288603e99c5aaefe'
'4170bcf3655ff6fb32b35fc592a4294a64d25df98d2f0f09f467689ed1ad54ea'
'1f4cd15749ff89fd564e216ff0c1f9ff085e0200dba24d74e3de948f681bd80f'
diff --git a/nonsystemd/openrc/openrc-hook b/nonsystemd/openrc/openrc-hook
index d7777e1ae..edeab0500 100644
--- a/nonsystemd/openrc/openrc-hook
+++ b/nonsystemd/openrc/openrc-hook
@@ -7,6 +7,19 @@ openrc_live() {
fi
}
+reexec_init() {
+ local init="$(pacman -Qsq ^init$)"
+
+ if [ $init = openrc-init ]; then
+ /usr/bin/openrc-shutdown -R
+ elif [ $init = sysvinit ]; then
+ /usr/bin/init u
+ else
+ echo >&2 " WARNING: Unidentified init."
+ exit 0
+ fi
+}
+
each_conf() {
while read -r f; do
"$@" "/$f"
@@ -18,7 +31,7 @@ op="$1"; shift
case $op in
sysctl) openrc_live; each_conf /usr/bin/sysctl -q -p ;;
binfmt) openrc_live; each_conf /usr/lib/openrc/sh/binfmt.sh ;;
- reexec) openrc_live; /usr/bin/openrc-shutdown -R ;;
+ reexec) openrc_live; reexec_init ;;
# For use by other packages
reload) openrc_live; /usr/bin/rc-service "$@" reload ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;