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