ports/main/nnd-s6-services/rc/mount.proc/up

27 lines
483 B
Plaintext
Raw Normal View History

2022-03-21 12:25:55 +00:00
#!/bin/execlineb -P
define DEST /proc
define CLEANDEST proc
define FSTYPE procfs
2022-10-18 19:06:48 +00:00
s6-envdir -i /etc/s6/env/path
2022-03-21 12:25:55 +00:00
importas -i PATH PATH
s6-envdir -i /etc/s6/env/mount.${CLEANDEST}
2022-10-18 19:06:48 +00:00
importas -i OPTS OPTS
2022-03-21 12:25:55 +00:00
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
# TODO: Handle procfs being potentially mounted ahead of service execution (initrd)
2022-03-21 12:25:55 +00:00
foreground {
2022-10-18 19:06:48 +00:00
foreground {
exec mkdir -p $DEST
} exec mount -t $FSTYPE -o $OPTS procfs $DEST
2022-03-21 12:25:55 +00:00
} if -nt {
importas status ? test $status -eq 1
}