Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | # |
| 5 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
| 15 | PATH="/sbin:/bin:/usr/sbin:/usr/bin" |
| 16 | |
| 17 | # Kill all processes. |
| 18 | echo "Sending all processes the TERM signal..." |
| 19 | killall5 -15 |
| 20 | sleep 5 |
| 21 | echo "Sending all processes the KILL signal..." |
| 22 | killall5 -9 |
| 23 | |
| 24 | # We start update here, since we just killed it. |
| 25 | test -x /sbin/update && update |
| 26 | |
| 27 | echo "Entering single-user mode..." |
| 28 | exec init -t1 S |