Bug 285543 - rc keywords: enable, disable, delete cannot manage certain built-in rc startup items.
Summary: rc keywords: enable, disable, delete cannot manage certain built-in rc startu...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-rc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-20 06:31 UTC by ykla
Modified: 2025-05-08 00:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ykla 2025-03-20 06:31:54 UTC
rc keywords: enable, disable, delete cannot manage certain built-in rc startup items.

--------------------------
root@ykla:~ # sysrc gateway_enable="YES"
gateway_enable: YES -> YES
root@ykla:~ # service gateway disable
gateway does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root@ykla:~ # sysrc gateway_enable="NO"
gateway_enable: YES -> NO
root@ykla:~ # service gateway enable
gateway does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root@ykla:~ # sysrc gateway_enable="YES"
gateway_enable: NO -> YES
root@ykla:~ # service gateway delete
gateway does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
----------------------------------

Similar issues also include sysrc ipv6_gateway_enable="YES", sysrc firewall_nat_enable="YES", and so on.
Comment 1 ykla 2025-03-20 06:32:33 UTC
see also  https://reviews.freebsd.org/D17113
Comment 2 ykla 2025-03-20 06:43:14 UTC
(In reply to ykla from comment #0)

add sysrc firewall_enable="YES"
Comment 3 Jose Luis Duran freebsd_committer freebsd_triage 2025-03-20 20:37:26 UTC
Although I agree that this can be frustrating, gateway is not a service. 

That is, gateway_enable and ipv6_gateway_enable are just variables that are checked under the routing service, they just happen to be named *_enable.

The case for firewall, is a little different. It gets set under ipfw:

    # service ipfw enable
    ipfw enabled in /etc/rc.conf
    # sysrc firewall_enable
    firewall_enable: YES

    # service ipfw disable
    ipfw disabled in /etc/rc.conf
    # sysrc firewall_enable
    firewall_enable: NO

If we inspect the ipfw rc.d script, you'll find that rcvar is defined as firewall_enable.  The reason for this discrepancy is likely historic.

In short, confusing, but IMO not a bug.