File: overlay-init

package info (click to toggle)
overlay-boot 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: sh: 253; makefile: 59; ansic: 26
file content (27 lines) | stat: -rwxr-xr-x 628 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#
# This script performs default actions. It is invoked with CONFIG set
# for the subhost.

OVERLAYDIR="$(dirname $(realpath $0))"
. $OVERLAYDIR/functions

subhost_name "$CONFIG"
subhost_config

# Print the default init script
cat <<EOF
set -x
mount -t proc proc /proc
for srv in $START ; do service \$srv start ; done
dummy_service() {
    [ \$# -gt 3 ] && return 0
    echo "Starting dummy service" >&2
    set +x
    [ -p /run/dummy_service ] || mkfifo /run/dummy_service
    ( printf dummy_service > /proc/self/comm ; read X < /run/dummy_service ) &
    set -x
}
dummy_service /proc/*/comm
exec /.reaper $NAME
EOF