Created
July 13, 2015 14:22
-
-
Save botto/e57c97b447443b7051ef to your computer and use it in GitHub Desktop.
A way to fork bash
This file contains hidden or 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
endFork () { | |
reboot | |
exit | |
} | |
trap endFork SIGHUP SIGINT SIGTERM | |
chroot /rootfs/ /bin/bash /boot/to-run.sh $$ & | |
while true; do | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your to-run simply call kill -s SIGHUP $1