1#!/bin/sh
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
6### BEGIN INIT INFO
7# Provides:          single
8# Required-Start:    $local_fs $all killprocs
9# Required-Stop:
10# Default-Start:     1
11# Default-Stop:
12# Short-Description: executed by init(8) upon entering runlevel 1 (single).
13### END INIT INFO
14
15PATH="/sbin:/bin:/usr/sbin:/usr/bin"
16
17# Kill all processes.
18echo "Sending all processes the TERM signal..."
19killall5 -15
20sleep 5
21echo "Sending all processes the KILL signal..."
22killall5 -9
23
24# We start update here, since we just killed it.
25test -x /sbin/update && update
26
27echo "Entering single-user mode..."
28exec init -t1 S
29