Created
September 23, 2014 21:05
-
-
Save fbriere/db827896e3fa2e1b42d4 to your computer and use it in GitHub Desktop.
Simple init process to start basic services and get a root shell with job control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Simple /sbin/init replacement that runs all runlevel S scripts, then drops | |
# into a root shell, in an infinite loop. | |
# | |
# Using this script as "init=" is similar to using the "single" boot parameter, | |
# but doesn't require a password, and logging out won't resume booting. And | |
# unlike "init=/bin/sh", this provides job control and runs the basic scripts. | |
/etc/init.d/rc S | |
while true; do | |
setsid sh -c 'exec login -f root </dev/tty1 >/dev/tty1 2>&1' | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment