]> git.proxmox.com Git - aab.git/blame - scripts/init.bash
mask systemd-journald-audit.socket
[aab.git] / scripts / init.bash
CommitLineData
7b25f331
WB
1#!/usr/bin/bash
2
3# no runlevels
4(($$ != 1)) && exit 0
5
6msg() {
7 local mesg="$1"; shift
8 printf "${mesg}\n" "$@"
9}
10
11die() {
12 local mesg="$1"; shift
13 printf "error: ${mesg}\n" "$@" >&2
14 exit 1
15}
16
17do_exit() {
18 msg "stopping init";
19 exit 0
20}
21
22# lxc sends 48 for some reason with --kill instead of stopsignal
23trap do_exit SIGINT SIGTERM SIGHUP SIGPWR 48
24
25msg "starting bash init... $*"
26
27[[ -d "/proc/$$" ]] || mount -t proc proc /proc \
28 || die 'unable to mount /proc'
29
30hostname localhost || die 'unable to set hostname'
31
32sleep infinity &
33wait