[Bug 208445] /usr/sbin/service: WARNING: $xyz is not set properly - see rc.conf(5).
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Mar 9 11:13:47 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208445
misc-freebsd-bugzilla at talk2dom.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |misc-freebsd-bugzilla at talk2
| |dom.com
--- Comment #3 from misc-freebsd-bugzilla at talk2dom.com ---
Still present in FreeBSD12.0-RELEASE
"$ is not set properly"
... is caused by this in /etc/rc.d/addswap:
rcvar=
and this code in service(8):
eval `grep ^rcvar $file`
if [ -n "$rcvar" ]; then
load_rc_config_var ${name} ${rcvar}
fi
checkyesno $rcvar 2>/dev/null && echo $file
So although service(8) checks whether $rcvar has non-zero length (-n), it still
goes on to use it with checkyesno (from /etc/rc.subr) which emits the warning.
Other /etc/rc.d scripts with empty rcvar, like dhclient, have "nostart" in
their keywords so are not considered by service(8) thanks to it calling
rcorder(8) with "-s nostart"
That's the 'why' but I don't know enough to say whether the fix should be:
1. move checkyesno inside the if-block for service(8)
2. change checkyesno to remove warning if arg (rcvar) is unset/empty
3. add "nostart" keyword /etc/rc.d/addswap
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list