aboutsummaryrefslogtreecommitdiff
path: root/init.d/bootmisc.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2020-11-27 15:13:40 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2020-11-27 15:18:57 -0600
commit0fab3e837b45021fdcc02a71873c3c245ce96080 (patch)
tree634bfb0361622d7472d6082593e5bc25f538badd /init.d/bootmisc.in
parent38aaba28ee86602e29d8a31f155dfa72f5481e68 (diff)
bootmisc: allow sysvinit compatibility during shutdown
Use "halt -w" to write the halt record if it exists. Otherwise use openrc-shutdown. This fixes #336.
Diffstat (limited to 'init.d/bootmisc.in')
-rw-r--r--init.d/bootmisc.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index bf79f03d..43da1869 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -241,7 +241,13 @@ stop()
{
# Write a halt record if we're shutting down
if [ "$RC_RUNLEVEL" = shutdown ]; then
- [ "$RC_UNAME" = Linux ] && openrc-shutdown -w
+ if [ "$RC_UNAME" = Linux ]; then
+ if [ -x /sbin/halt ]; then
+ halt -w
+ else
+ openrc-shutdown -w
+ fi
+ fi
if [ "$RC_SYS" = OPENVZ ]; then
yesno $RC_REBOOT && printf "" >/reboot
fi