Skip to content

Instantly share code, notes, and snippets.

@fbriere fbriere/init.shell
Created Sep 23, 2014

Embed
What would you like to do?
Simple init process to start basic services and get a root shell with job control
#!/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
You can’t perform that action at this time.