Solved boot process - rc(8) tries to start some services twice

Lanakus

Member

Thanks: 20
Messages: 57

#1
Hi everyone,

I recognized that rc(8) tries to start some service twice during initialization. E.g., i got the following messages
Code:
Starting dbus.                                                                                                                                                                                                   
Starting dbus.                                                                                                                                                                                                   
Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file                                                                                         
/etc/rc: WARNING: failed to start dbus                                                                               
...
Starting powerdxx.                                                                                                                                                                                               
Starting powerdxx.                                                                                                                                                                                               
powerd++: (ECONFLICT) a power daemon is already running under PID: 800                                                                                                                                           
/etc/rc: WARNING: failed to start powerdxx
My non-default settings actually looks like this
Code:
#  sysrc -a

cupsd_enable: YES
dbus_enable: YES
devfs_system_ruleset: system_ruleset
dumpdev: AUTO
hostname: BSDdesktop
ifconfig_ale0: DHCP
ifconfig_ale0_ipv6: inet6 accept_rtadv
keymap: de
kld_list:  /boot/modules/radeonkms.ko aesni cc_htcp coretemp cpuctl fuse msdosfs_iconv libiconv libmchain
linux_enable: YES
pf_enable: YES
pf_flags:
pf_rules: /etc/pf.conf
powerd_enable: NO
powerdxx_enable: YES
smartd_enable: YES
sshd_enable: YES
tmpsize: 512M
zfs_enable: YES
The services are running so no big problem but whats going wrong there?
 
OP
OP
Lanakus

Lanakus

Member

Thanks: 20
Messages: 57

#3
Code:
/etc/rc.conf:

# Hostname
hostname="BSDdesktop"

# Kernel modules
kld_list="${kld_list} /boot/modules/radeonkms.ko aesni cc_htcp coretemp cpuctl"
kld_list="${kld_list} fuse msdosfs_iconv libiconv libmchain"

# Enable ruleset from /etc/devfs.rules
devfs_system_ruleset="system_ruleset"

# Ethernet
ifconfig_ale0="DHCP"
ifconfig_ale0_ipv6="inet6 accept_rtadv"

# Firewall
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""

# Secure Shell remote access
sshd_enable="YES"

dumpdev="AUTO"

# SMART daemon
smartd_enable="YES"

# Mouse daemon for usage in console
#moused_enable="YES"

# Keymap
keymap="de"

# DBus and HAL daemon, if needed
dbus_enable="YES"
#hald_enbale="YES"

# Graphical login via xdm. Need also to edit /etc/ttys, switch ttyv8 to on
#xdm_enable="YES"

# Printing
cupsd_enable="YES"

# Linux binary compability
linux_enable="YES"

# System power control
powerd_enable="NO"
powerdxx_enable="YES"

# ZFS
zfs_enable="YES"

# mdmfs on /tmp
#tmpmfs="YES"
tmpsize="512M"

### EoF ###
 
OP
OP
Lanakus

Lanakus

Member

Thanks: 20
Messages: 57

#7
Thanks for your replies!

What FreeBSD version is this? And what version of sysutils/hal are you using?
Im actually on 11.2-R-p6. I leave HAL disabled in favor of BSD's native devd(8). Almost all devices are autodetected out of the box.

See rc_debug in rc.conf(5), it could help here
Thanks, I enabled rc_debug and got the following lines
Code:
/etc/rc: DEBUG: checkyesno: dbus_enable is set to YES.
/etc/rc: DEBUG: run_rc_command: start_precmd: dbus_prestart
/etc/rc: DEBUG: checkyesno: rc_startmsgs is set to YES.                                                                                                                                                          
Starting dbus.                                                                                                                                                                                      
/etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/bin/dbus-daemon --system                                                                                                          
/etc/rc: DEBUG: checkyesno: dbus_enable is set to YES.                                                                                                                                                          
/etc/rc: DEBUG: run_rc_command: start_precmd: dbus_prestart                                                                                                                                                      
/etc/rc: DEBUG: checkyesno: rc_startmsgs is set to YES.                                                                                                                                                          
Starting dbus.                                                                                                                                                                                                  
/etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/bin/dbus-daemon --system                                                                                                                      
Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file                                                                                        
/etc/rc: WARNING: failed to start dbus
...
/etc/rc: DEBUG: checkyesno: powerd_enable is set to NO.                                                                                                                                                          
/etc/rc: DEBUG: checkyesno: powerdxx_enable is set to YES.                                                                                                                                                      
/etc/rc: DEBUG: checkyesno: rc_startmsgs is set to YES.                                                                                                                                                          
Starting powerdxx.                                                                                                                                                                                              
/etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/sbin/powerd+
...
/etc/rc: DEBUG: checkyesno: powerdxx_enable is set to YES.                                                                                                                                                      
/etc/rc: DEBUG: checkyesno: rc_startmsgs is set to YES.                                                                                                                                                          
Starting powerdxx.                                                                                                                                                                                              
/etc/rc: DEBUG: run_rc_command: doit:  limits -C daemon /usr/local/sbin/powerd++                                                                                                                                
powerd++: (ECONFLICT) a power daemon is already running under PID: 1136                                                                                                                                          
/etc/rc: WARNING: failed to start powerdxx
But I can't figure it out.
 

ShelLuser

Son of Beastie

Thanks: 1,569
Messages: 3,411

#8
I leave HAL disabled in favor of BSD's native devd(8). Almost all devices are autodetected out of the box.
Sorry, my bad: I meant devel/dbus. Dumb mistake on my part; generally these two go hand in hand (as far as I can tell) and I mixed them up.

What does pkg info -lx dbus tell you?

I'm tempted to blame this on a glitch with dbus but I'm obviously not sure. How did you install dbus (ports or packages)? If you used ports (so build it yourself) please also share the output from running make showconfig in /usr/ports/devel/dbus.
 
OP
OP
Lanakus

Lanakus

Member

Thanks: 20
Messages: 57

#9
Im using pkg for software management and /devel/dbus is Version 1.10.16_1. I think I installed it along with x11/xorg some time ago.

BTW, its all about services their rc scripts are located in /usr/local/etc/rc.d, namely dbus, powerdxx and cupsd. But cupsd is started twice during boot process without a warning.. strange behaviour.
 

Sensucht94

Well-Known Member

Thanks: 356
Messages: 374

#10
Perhaps a look at /usr/local/etc/rc.d, /etc/rc.d folder contents as well as /etc/rc.local script? Is it possible you unwantedly created a second copy or a symlink of the same services in /etc/rc.d too? Is there any custom service script, or custom rc.local you're using?

I'll stress that all services attempted to be started twice come from 3rd party software not found in base and as such, by default located in /usr/local/etc/rc.d only
 
OP
OP
Lanakus

Lanakus

Member

Thanks: 20
Messages: 57

#12
Okay, you were right. There are 3rd party scripts in both /usr/local/etc/rc.d and /etc/rc.d. All files in /etc/rc.d were added at 11/29/2018, but Im pretty sure it wasn't me. Really weird!

Looking more deeply at /etc it seems there is a copy of all /usr/local/etc/*. How could that happen? Is there a way I could undo these changes or should I try a fresh install?
 
OP
OP
Lanakus

Lanakus

Member

Thanks: 20
Messages: 57

#13
Update! Okay Maybe it was me :rolleyes:. Very possible that mixed it while setting up subversion repos! Seems I was not in a good shape.. Thanks for your efforts and sorry for your stolen time and don't tell anybody :sssh:
 
Top