Does my new rc.conf have errors in it?

I'm relatively new to BSD, and right now I'm test driving 15.0 in order to see if I can use it as my daily operating system. Thus far things seems promising, but last week I accidentally threw a monkey wrench into my own machine, by accidentally deleting the contents inside my /etc/rc.conf file.

Well, the first thing that I did was to find an example rc.conf file on the Internet, and then I copied and pasted that into my own blank rc.conf file. Next I rebooted and re did all of the sysrc commands I had used during the original installation, a few days earlier. This seemed to give me a working system, but now I seem to be experiencing a few odd quirks, such as my camera no longer working in Firefox, when it used to work before. I've tried to figure this out on my own, but I just don't seem to be smart enough to figure it out on my own. Also, I'm wondering if I may have created other conflicts in my system by adding too much gibberish into rc.conf.

Any information greatly appreciated.



Code:
hostname="Asus"
ifconfig_em0="DHCP"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"
dumpdev="NO"
sendmail_enable="NO"
syslogd_flags="-c -ss"
microcode_update_enable="YES"
hald_enable="YES"
dbus_enable="YES"
linux_enable="YES"
avahi_daemon_enable="YES"
fsck_enable="YES"
swapexd_enable="YES"
clean_tmp_X="YES"
clear_tmp_enable="YES"
devd_enable="YES"
devfs_system_ruleset="devfsrules_common"
tcp_drop_synfin="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""
ssh_enable="NO"





# kld_list+="nvidia nvidia-modeset"
moused_enable="YES"
ifconfig_re0="DHCP"
defaultrouter="192.168.1.1"
kld_list="nvidia-drm cuse"
lightdm_enable="Yes"
webcamd_enable="YES"
webcamd_0_flags="-d /dev/video0"
# webcamd_0_flags="-N vendor-0x046d-product-0x0825"
cupsd_enable="YES"
devfs_system_ruleset="system"
 
If you mean syntactically you can always do
sh:
sh -n /etc/rc.conf

If you mean is it correct for your system and needs than that's on you, no one else has all the details (eg if you are using zfs than enabling fsck is pointless).

If you mean stylistically than I can offer my opinion that you need more comments, you should group like things together (ie networking stuff in one group), make sure the comments are correct, not be afraid of blank lines, and separate pkg things from system things.
 
If you mean syntactically you can always do
sh:
sh -n /etc/rc.conf

If you mean is it correct for your system and needs than that's on you, no one else has all the details (eg if you are using zfs than enabling fsck is pointless).

If you mean stylistically than I can offer my opinion that you need more comments, you should group like things together (ie networking stuff in one group), make sure the comments are correct, not be afraid of blank lines, and separate pkg things from system things.
The above command didn't return any results, so I guess that there is nothing in my rc.conf file which is bringing my system to its knees. Also, I guess I should have phrased my original post a little bit better, as I realize that there is no way that others could know if the information was correct for my particular machine, but I was thinking that my rc.conf might be loading conflicting services, or maybe trying to load services which don't actually exist. Anyway, thank you very much for the info.
 
Code:
hostname="Asus"
# Networking
ifconfig_em0="DHCP"
ifconfig_re0="DHCP"
defaultrouter="192.168.1.1"

# Kernel Modules (Graphics & Hardware)
# Combined nvidia-modeset for better 2026 compatibility
kld_list="nvidia-modeset nvidia-drm cuse"
microcode_update_enable="YES"
linux_enable="YES"

# Desktop & System Services
dbus_enable="YES"
hald_enable="YES"
lightdm_enable="YES"
moused_enable="YES"
webcamd_enable="YES"
cupsd_enable="YES"
avahi_daemon_enable="YES"

# Power & Time
ntpd_enable="YES"
ntpd_sync_on_start="YES"
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"

# Security & Cleanup
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
sendmail_enable="NO"
syslogd_flags="-c -ss"
clear_tmp_enable="YES"
clean_tmp_X="YES"

# Device Management
devd_enable="YES"
# Use only ONE ruleset (ensure it exists in /etc/devfs.rules)
devfs_system_ruleset="system"
fsck_enable="YES"
 
Code:
hostname="Asus"
# Networking
ifconfig_em0="DHCP"
ifconfig_re0="DHCP"
defaultrouter="192.168.1.1"

# Kernel Modules (Graphics & Hardware)
# Combined nvidia-modeset for better 2026 compatibility
kld_list="nvidia-modeset nvidia-drm cuse"
microcode_update_enable="YES"
linux_enable="YES"

# Desktop & System Services
dbus_enable="YES"
hald_enable="YES"
lightdm_enable="YES"
moused_enable="YES"
webcamd_enable="YES"
cupsd_enable="YES"
avahi_daemon_enable="YES"

# Power & Time
ntpd_enable="YES"
ntpd_sync_on_start="YES"
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"

# Security & Cleanup
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
sendmail_enable="NO"
syslogd_flags="-c -ss"
clear_tmp_enable="YES"
clean_tmp_X="YES"

# Device Management
devd_enable="YES"
# Use only ONE ruleset (ensure it exists in /etc/devfs.rules)
devfs_system_ruleset="system"
fsck_enable="YES"
Thank you very very much. This explains a lot, and it makes it easier for me to understand what is going on.
 
Well, I copied and pasted the above information into my etc/rc.conf file, and everything seemed to go very well, except for one minor problem, which I may have found a temporary solution for.

The problem seemed to center around the below line:
Code:
devfs_system_ruleset="system"

I wasn't smart enough to create a workable /etc/devfs.rules file, so I changed to the above line to the below, and the problem seemed to go away:
Code:
devfs_system_ruleset="devfsrules_common"

I will try to work on this issue next weekend, and maybe try to do some reading on the topic during the week.

Also, when I enter the dmesg command, the only warning I seem to find is below:
Code:
atrtc0: Warning: Couldn't map I/O.

I'm not sure, but I think that the above warning is related to my video card, but it doesn't seem to be critical, and it can probably wait to next weekend.

Overall I'm happy with FreeBSD thus far, and thank you for the help, Everyone.
 
Regarding:

fsck_enable="YES"

My understanding is that the fsck script runs unconditionally, and that that variable is ignored. If fsck_enable did anything there would be a default set in defaults/rc.conf.
 
I'm relatively new to BSD, and right now I'm test driving 15.0 in order to see if I can use it as my daily operating system. Thus far things seems promising, but last week I accidentally threw a monkey wrench into my own machine, by accidentally deleting the contents inside my /etc/rc.conf file.

If you are relatively new too FreeBSD, how come you have such a complicated /etc/rc.conf.

FreeBSD boots up OK on my systems with this file being present.

Personally, I would add individual items as and when you need them. You make additions and activate them by running
service netif restart
 
My understanding is that the fsck script runs unconditionally, and that that variable is ignored. If fsck_enable did anything there would be a default set in defaults/rc.conf.
Yes and I thought the critical setting was bgfsck. You might need to turn off background fsck in certain corner cases.
I don't think half these settings do anything.
swapexd_enable="YES"
Do you have this installed ? The port was last updated in 2013...
sysutils/swapexd

avahi_daemon_enable="YES"
Do you know what this does? What programs require an audio daemon?

We have no idea if your list is sane. We don't know what programs you run.
 
Regarding:

fsck_enable="YES"

My understanding is that the fsck script runs unconditionally, and that that variable is ignored. If fsck_enable did anything there would be a default set in defaults/rc.conf.
I tried to do a little bit of research on this one, and it apperas that fsck is somewhat similar to chkdsk in Microsoft world, so I decided that I would keep it in my rc.conf file, as it doesn't seem to be cause any problems during boot.
 
Code:
fsck_y_enable="YES"     # Set to YES to do fsck -y if the initial preen fails.
background_fsck="NO"   # Attempt to run fsck in the background where possible.
#background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
 
Yes you better remove the defaultrouter line.

I also have IPV6 config,
Code:
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
ipv6_activate_all_interfaces="YES"
ipv6_privacy="YES"               # Use privacy address on RA-receiving IFs  # (RFC 4941)
rtsold_enable="YES"
ip6addrctl_enable="YES"            # Set to YES to enable default address selection
ip6addrctl_policy="ipv6_prefer"    # Set to YES to enable default address selection
ip6addrctl_verbose="NO" # Set to YES to enable verbose configuration messages

And in sysctl.conf
Code:
net.inet6.ip6.temppltime=7200            # 86400 ,  Maximum preferred lifetime for temporary addresses
net.inet6.ip6.tempvltime=14400           # 604800 , Maximum valid lifetime for temporary addresses
net.inet6.ip6.accept_rtadv=1             #0 Default value of per-interface flag for accepting ICMPv6 RA messages
net.inet6.ip6.fw.enable=1
 
Yes and I thought the critical setting was bgfsck. You might need to turn off background fsck in certain corner cases.
I don't think half these settings do anything.
I agree.

I like to start with as little as possibe and add entries as and when needed to get an understanding of what they are for.
 
If you are relatively new too FreeBSD, how come you have such a complicated /etc/rc.conf.

FreeBSD boots up OK on my systems with this file being present.

Personally, I would add individual items as and when you need them. You make additions and activate them by running
service netif restart
I suppose that a command such as service netif restart might be very useful once I know a bit more, but for now I'm still learning everyhing the hard way, which is why my rc.conf file looks so complicated.

Actually, I'm one of those people who keeps pointlessly playing with software settings until everything is broken, and then I learn by trying to make it bootable again.

For example, I really made a big mistake yesterday afternoon. I noticed that Xfce didn't always boot smoothly each time I started my computer, so I did a little searching on the Internet, and I found that many people recommended installing a different nvidia driver as below:

Code:
 kld_list="linux nvidia nvidia_modeset"

However, after I did the above, I got an error message similar to below:

Code:
VRM: API mismatch: the client 'Xorg" (pid 3591)
NVRM: has the version 580.95.95, but this kernel module has
NVRM: the version 580.105.08. Please make sure that this
NVRM: kernel module and all NVIDIA driver components

I tried to fix it on my own, but the best I could do was to have Xfce boot to a black screen with a white square in the upper left corner.

Well, at least I learned how to bring up the network in single user mode. Also, I now know how to mount adaop2 and how to modify files using the ee command. So maybe I will be able to fix it next weekend.
 
Back
Top