Commit da2b759
committed
Handle special YES/NO values for service flags
Certain rc.conf(8) variables configurable via rcctl(8) do not correspond
to services; en/disabled ones report YES/NO as flags value, which is an
implementation detail and thus cannot work as daemon flags:
```
$ rcctl get multicast
multicast=NO
$ rcctl get pf flags
YES
# rcctl set pf flags foo
rcctl: "pf" is a special variable, cannot "set flags"
```
Actual services may have default flags set in their `/etc/rc.d/*` scripts,
but also report NO unless they are enabled:
```
$ rcctl get rarpd status ; echo $?
1
$ rcctl get rarpd flags
NO
$ rcctl getdef rarpd flags
-a
```
Turn those into `nil` for puppet-resource(8) to yield proper flags:
```
$ puppet resource service pf
service { 'pf':
ensure => 'stopped',
enable => 'true',
- flags => 'YES',
provider => 'openbsd',
}
$ puppet resource service rarpd
service { 'rarpd':
ensure => 'stopped',
enable => 'false',
- flags => 'NO',
provider => 'openbsd',
}
```1 parent 0a4c63e commit da2b759
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
0 commit comments