File: runit-policy-rc.d

package info (click to toggle)
runit-run 0.5.0
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 112 kB
  • ctags: 3
  • sloc: sh: 134; makefile: 49
file content (48 lines) | stat: -rwxr-xr-x 843 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

# /usr/sbin/policy-rc.d [options] <initscript ID> <actions> [<runlevel>]
# /usr/sbin/policy-rc.d [options] --list <initscript ID> [<runlevel> ...]

# runit's init script policy: don't run init scripts at all.

usage() {
  cat >&2 <<EOT
usage: policy-rc.d [--quiet] <initscript ID> <actions> [<runlevel>]
usage: policy-rc.d --list <initscript ID> [<runlevel> ...]

EOT
  exit 103  # syntax error
}

quiet=0
list=0
while test $# -gt 0; do
  case "$1" in
  --*)
    case "$1" in
    --quiet) quiet=1 ;;
    --list) list=1 ;;
    *) usage
    esac
    ;;
  *)
    break
    ;;
  esac
  shift
done
test $# -eq 0 && usage

if test "$list" -eq 1; then
  cat <<EOT
runit's init script policy is to not run any init scripts at all.

EOT
  exit 0
fi

test "$quiet" -ne 1 && cat >&2 <<EOT
runit-policy-rc.d: forbid: $*
EOT

exit 101  # forbid