Created attachment 306819 [details] rc.log.bad the setup: server gets ip via DHCP, but has (noncritical) errors on FS due to unsynced clock (superblock has 'future' timestamp) The box was properly rebooted (it does not save system time to hardware, thus the oddity). rc.log.bad: here you can see it does not start 'hostname' at boot for some reason so fails to register it's name by dhcp rc.log.good: hostname, swaps and thus other things started fine questions: 1) why it bailouts from 'boot'? bug/feature? 2) shouldn't dhcp need hostname? (at least by default) That machine never had clock synced, so that error was at each bootup (*shame*), but only recently it started losing it's hostname I've fixed closk issue, but i can roll things back to test possible fixes/config tuning.
Created attachment 306821 [details] rc.log.good
HI Sergei, The only difference I noticed between rc.log.{good,bad} is * Starting libvirtd ... 2012-03-27 06:29:06.383+0000: 3117: info : libvirt version: 0.9.10 2012-03-27 06:29:06.383+0000: 3117: warning : virGetHostname:2029 : getaddrinfo failed for 'vmhost': Name or service not known What do you mean by "so fails to register it's name by dhcp" provided the following is in log.bad: [ ok ] * dhcp ... * Running dhcpcd ... dhcpcd[2550]: version 5.2.12 starting dhcpcd[2550]: br0: rebinding lease of 192.168.234.79 dhcpcd[2550]: br0: acknowledged 192.168.234.79 from 192.168.234.1 dhcpcd[2550]: br0: checking for 192.168.234.79 dhcpcd[2550]: br0: leased 192.168.234.79 for 518400 seconds dhcpcd[2550]: forked to background, child pid 2579 [ ok ] * received address 192.168.234.79/24 Or did I miss something?
THe thing is in order of hostname/dhcp service bootup sequence. Compare last two boot phases [i'll skip module load]: - bad [no hostname]: rc boot logging started at Mon Mar 5 12:31:20 2012 * Setting system clock using the hardware clock [UTC] ... [ ok ] * Autoloaded 4 module(s) * Checking local filesystems ... /dev/sda1: clean, 581753/3662848 files, 3315641/7323624 blocks /dev/sda5: Superblock last write time (Tue Mar 27 09:23:03 2012, now = Mon Mar 5 12:31:22 2012) is in the future. /dev/sda5: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) ISO_IMAGES: Superblock last write time (Tue Mar 27 09:23:00 2012, now = Mon Mar 5 12:31:22 2012) is in the future. ISO_IMAGES: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) VM_IMAGES: Superblock last write time (Tue Mar 27 09:23:00 2012, now = Mon Mar 5 12:31:23 2012) is in the future. VM_IMAGES: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) BACKUP: Superblock last write time (Tue Mar 27 09:23:00 2012, now = Mon Mar 5 12:31:23 2012) is in the future. BACKUP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) * Fileystem errors left uncorrected, aborting [ !! ] * rc: Aborting! rc boot logging stopped at Mon Mar 5 12:31:23 2012 - good: rc boot logging started at Tue Mar 27 09:45:55 2012 * Setting system clock using the hardware clock [UTC] ... [ ok ] * Autoloaded 4 module(s) * Checking local filesystems ... /dev/sda1: clean, 581749/3662848 files, 3314849/7323624 blocks /dev/sda5: clean, 675481/15400960 files, 21187714/30772499 blocks ISO_IMAGES: clean, 66/20332544 files, 5254411/81298932 blocks VM_IMAGES: clean, 30/20332544 files, 12073869/81298940 blocks BACKUP: clean, 211935/20398080 files, 33403680/81592126 blocks [ ok ] * Remounting root filesystem read/write ... [ ok ] * Remounting filesystems ... [ ok ] * Updating /etc/mtab ... [ ok ] * Activating swap devices ... [ ok ] * Mounting local filesystems ... [ ok ] * Configuring kernel parameters ... [ ok ] * Creating user login records ... [ ok ] * Cleaning /var/run ... [ ok ] * Wiping /tmp directory ... [ ok ] * Setting terminal encoding [UTF-8] ... [ ok ] * Setting console font [default8x16] ... [ ok ] * Setting hostname to vmhost ... [ ok ] * Setting keyboard mode [UTF-8] ... [ ok ] * Loading key mappings [us] ... [ ok ] * Bringing up interface lo * 127.0.0.1/8 ... [ ok ] * Adding routes * 127.0.0.0/8 via 127.0.0.1 ... [ ok ] * Mounting misc binary format filesystem ... [ ok ] * Loading custom binary format handlers ... [ ok ] * Mounting USB device filesystem [usbfs] ... [ ok ] * Activating additional swap space ... [ ok ] * Initializing random number generator ... [ ok ]
Hi Sergei, I understand the problem now. Usually, dhcp is brought up in default runlevel, while fsck and hostname is in boot runlevel. From the openrc manpage: boot Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here. "boot" level is included in "default". But in /etc/inittab, # System initialization, mount local filesystems, etc. si::sysinit:/sbin/rc sysinit # Further system initialization, brings up the boot runlevel. rc::bootwait:/sbin/rc boot l0:0:wait:/sbin/rc shutdown l0s:0:wait:/sbin/halt -dhp l1:1:wait:/sbin/rc single l2:2:wait:/sbin/rc nonetwork l3:3:wait:/sbin/rc default "sysinit" then "boot" then "default" runlevels are entered in order. Therefore dhcp will run after hostname. But from your rc.log.bad case, fsck fails, which terminates rc: 4) if [ "$RC_UNAME" = Linux ]; then ewend 1 "Fileystem errors left uncorrected, aborting" _abort else ewend 1 "Filesystems repaired, but reboot needed" _reboot fi;; the scripts in boot are not assured to start when it aborts. When you issue 'rc default' boot is included in default all services in boot and default are treated equal. dhcp and hostname's order will be undefined. so for your questions: 1) why it bailouts from 'boot'? bug/feature? feature 2) shouldn't dhcp need hostname? (at least by default) I think dhcp should need hostname, if the ip is determined by hostname at dhcp server end.
> 1) why it bailouts from 'boot'? bug/feature? > > feature Heh ok, rather odd one. Why not try to start the rest of boot (independent) services? [just a thought] Given it actually starts 'default' runlevel which produces silly results and happens to mask some errors. [ not too relevant, just a slight rant ] I have this machine in clock skewy state for ~1 year. On each second reboot it fsck'ed all the filesystems for ~5 minutes and didn't up the network correctly. Folks say second reboot usually helped to get machine back. One of HDDs died after 8 months of such life and i've discovered this openrc feature after discovering there is /var/log/rc.log. [ /rant ] I don't know how to make such things a bit more visible for a user. Maybe, openrc should tell more things to syslog by default with CRIT priority. > 2) shouldn't dhcp need hostname? (at least by default) > > I think dhcp should need hostname, if the ip is determined by hostname at > dhcp server end.
It looks to me like hostname runs pretty late in the boot sequence. I'm wondering if we should adjust the dependencies of another service in the boot sequence to cause hostname to be needed before fsck is run?
Let's close it as obsolete. I've replaced the battery on that sad host and clock skew is not a thing anymore.