initial import

This commit is contained in:
Wolfgang Bumiller
2015-08-21 09:08:11 +02:00
commit 7b25f3312e
5 changed files with 821 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/bash
# no runlevels
(($$ != 1)) && exit 0
msg() {
local mesg="$1"; shift
printf "${mesg}\n" "$@"
}
die() {
local mesg="$1"; shift
printf "error: ${mesg}\n" "$@" >&2
exit 1
}
do_exit() {
msg "stopping init";
exit 0
}
# lxc sends 48 for some reason with --kill instead of stopsignal
trap do_exit SIGINT SIGTERM SIGHUP SIGPWR 48
msg "starting bash init... $*"
[[ -d "/proc/$$" ]] || mount -t proc proc /proc \
|| die 'unable to mount /proc'
hostname localhost || die 'unable to set hostname'
sleep infinity &
wait