[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#846915: Fixing OpenRC halt/reboot behavior by updating initscripts



Package: initscripts
Version: 2.88dsf-59.8
Severity: important
Tags: patch
X-Debbugs-CC: 844685@bugs.debian.org, pkg-sysvinit-devel@lists.alioth.debian.org, openrc-devel@lists.alioth.debian.org, debian-devel@lists.debian.org

Hello guys,

I find a simple way to fix an OpenRC bug [1] by updating initscripts
package. So both sysvinit list and openrc list are rolled in the CC list.

The OpenRC bug [1] is introduced by this commit:

https://anonscm.debian.org/cgit/openrc/openrc.git/commit/?id=f1ec5852df7db55e7bb170b26997c75676430c5b

It removed the "transit" script and the "reboot" and "halt"
behavior gets broken in my kfreebsd-amd64 virtual machine.
>From the openrc maintainer's comments and logs, it seems that
keeping "transit" script is a pain to them.

However, I fixed this problem in my kfreebsd virtual machine
adding merely two lines of code in initscripts. Maybe this
is better than bringing the "pain" back to openrc maintainers?

I'm not quite familiar with openrc and initscripts so I'm not
sure if my solution is correct.

P.S. It is really annoying when I cannot poweroff my kfreebsd
virtual machine with any of them: "poweroff" "halt" "shutdown"
except for "/etc/init.d/halt stop".

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844685
From 1b32fc20368f008ab1f5f9197ef8b294efdb76f9 Mon Sep 17 00:00:00 2001
From: Zhou Mo <cdluminate@gmail.com>
Date: Sun, 4 Dec 2016 09:22:59 +0000
Subject: [PATCH] fix openrc halt and reboot behavior from initscripts side

Make sure that the "halt" and "reboot" services are both added into
runlevel "off":
 # rc-update add halt off
 # rc-update add reboot off
---
 debian/changelog                         | 8 ++++++++
 debian/src/initscripts/etc/init.d/halt   | 1 +
 debian/src/initscripts/etc/init.d/reboot | 1 +
 3 files changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1b4d1b9..ab7a61d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+sysvinit (2.88dsf-59.9) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add OpenRC support to /etc/init.d/{halt,reboot}, which fixes OpenRC
+    halt and reboot behavior since openrc version 0.21-4 . (Closes: #844685)
+
+ -- Zhou Mo <cdluminate@gmail.com>  Sun, 04 Dec 2016 09:18:29 +0000
+
 sysvinit (2.88dsf-59.8) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --git a/debian/src/initscripts/etc/init.d/halt b/debian/src/initscripts/etc/init.d/halt
index c179a25..45b82de 100755
--- a/debian/src/initscripts/etc/init.d/halt
+++ b/debian/src/initscripts/etc/init.d/halt
@@ -72,6 +72,7 @@ case "$1" in
 	exit 3
 	;;
   stop)
+    if [ "$RC_REBOOT" = "YES" ]; then exit 0; fi
 	do_stop
 	;;
   *)
diff --git a/debian/src/initscripts/etc/init.d/reboot b/debian/src/initscripts/etc/init.d/reboot
index e1dcb1c..1b61ee5 100755
--- a/debian/src/initscripts/etc/init.d/reboot
+++ b/debian/src/initscripts/etc/init.d/reboot
@@ -29,6 +29,7 @@ case "$1" in
 	exit 3
 	;;
   stop)
+    if [ "$RC_REBOOT" != "YES" ]; then exit 0; fi
 	do_stop
 	;;
   status)
-- 
2.10.2


Reply to: