xref: /openbmc/openbmc/poky/meta/recipes-core/initscripts/initscripts-1.0/halt (revision c124f4f2e04dca16a428a76c89677328bc7bf908)
1#!/bin/sh
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
6### BEGIN INIT INFO
7# Provides:          halt
8# Required-Start:
9# Required-Stop:
10# Default-Start:
11# Default-Stop:      0
12# Short-Description: Execute the halt command.
13# Description:
14### END INIT INFO
15
16PATH=/sbin:/bin:/usr/sbin:/usr/bin
17
18# See if we need to cut the power.
19if test -x /etc/init.d/ups-monitor
20then
21	/etc/init.d/ups-monitor poweroff
22fi
23
24# Don't shut down drives if we're using RAID.
25hddown="-h"
26if grep -qs '^md.*active' /proc/mdstat
27then
28	hddown=""
29fi
30
31halt SED_HALTARGS -p $hddown
32
33: exit 0
34