Bug in rc.d/ifstated ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in rc.d/ifstated ?

Christer Solskogen-3
If ifstated.conf have a error this will happen:

# ifstated
-d

/etc/ifstated.conf:35: syntax error
/etc/ifstated.conf:38: syntax error
error: state 'fw_slave' not declared
error: state 'fw_slave' not declared
unable to load config

But with the same config:
# /etc/rc.d/ifstated
start

ifstated(ok)
# echo $?
0
I would expect that it would say something like this, like other daemons do.
ifstated(failed)
Reply | Threaded
Open this post in threaded view
|

Re: Bug in rc.d/ifstated ?

Antoine Jacoutot-7
On Sat, Nov 11, 2017 at 07:09:13PM +0000, Christer Solskogen wrote:

> If ifstated.conf have a error this will happen:
>
> # ifstated
> -d
>
> /etc/ifstated.conf:35: syntax error
> /etc/ifstated.conf:38: syntax error
> error: state 'fw_slave' not declared
> error: state 'fw_slave' not declared
> unable to load config
>
> But with the same config:
> # /etc/rc.d/ifstated
> start
>
> ifstated(ok)
> # echo $?
> 0
> I would expect that it would say something like this, like other daemons do.
> ifstated(failed)

Yes, that's an known issue with several privsep daemons in OpenBSD...
Maybe we could add an rc_pre function like this:

# child will not return a config parsing error to the parent
rc_pre() {
        ${daemon} -n ${daemon_flags}
}

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: Bug in rc.d/ifstated ?

jungle Boogie
In reply to this post by Christer Solskogen-3
Thus said Christer Solskogen on Sat, 11 Nov 2017 20:09:13 +0100

> If ifstated.conf have a error this will happen:
>
> # ifstated
> -d
>
> /etc/ifstated.conf:35: syntax error
> /etc/ifstated.conf:38: syntax error
> error: state 'fw_slave' not declared
> error: state 'fw_slave' not declared
> unable to load config
>
> But with the same config:
> # /etc/rc.d/ifstated
> start
>
> ifstated(ok)
> # echo $?
> 0
> I would expect that it would say something like this, like other daemons do.
> ifstated(failed)
>

Here's a false start with ifstated:

$ ls -l /etc/if*
ls: /etc/if*: No such file or directory


$ doas /etc/rc.d/ifstated -f start
 
 

ifstated(ok)

$ pgrep ifstated

-----

Here's a legitimate failure with ntp:

$ ls -l /etc/nt*
ls: /etc/nt*: No such file or directory

$ doas /etc/rc.d/ntpd -f start
ntpd(failed)