single 578 B

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