Created
November 18, 2019 01:11
-
-
Save jorgicio/6c7ffa07477a3a69e61779db615afc5a to your computer and use it in GitHub Desktop.
Chroot daemon for OpenRC
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
#!/sbin/openrc-run | |
depend() { | |
need localmount | |
need bootmisc | |
} | |
start() { | |
ebegin "Mounting chroot directories" | |
mount -o rbind /dev /mnt/dev > /dev/null & | |
mount -t proc none /mnt/proc > /dev/null & | |
mount -o bind /sys /mnt/sys > /dev/null & | |
mount -o bind /tmp /mnt/tmp > /dev/null & | |
eend $? "An error occurred while mounting chroot directories" | |
} | |
stop() { | |
ebegin "Unmounting chroot directories" | |
umount -f /mnt/dev > /dev/null & | |
umount -f /mnt/proc > /dev/null & | |
umount -f /mnt/sys > /dev/null & | |
umount -f /mnt/tmp > /dev/null & | |
eend $? "An error occurred while unmounting chroot directories" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment