# [SOLVED]hwclock fails to start

## slugggerzzz

Guys, this has been doing my head in...

```
gb6-netsvr01 ~ # /etc/init.d/hwclock restart

 * WARNING: you are stopping a boot service

 * Setting hardware clock using the system clock [UTC] ...

hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.

 * Failed to sync clocks                                                                                      [ !! ]

 * ERROR: hwclock failed to stop

gb6-netsvr01 ~ #

```

With debug...

```
]

gb6-netsvr01 ~ # /etc/init.d/hwclock restart --debug

 * WARNING: you are stopping a boot service

+ _conf_d=/etc/init.d/../conf.d

+ _c=hwclock

+ '[' -n hwclock -a hwclock '!=' hwclock ']'

+ unset _c

+ sourcex -e /etc/init.d/../conf.d/hwclock.default

+ '[' -e = -e ']'

+ shift

+ '[' -e /etc/init.d/../conf.d/hwclock.default ']'

+ return 1

+ sourcex -e /etc/init.d/../conf.d/hwclock

+ '[' -e = -e ']'

+ shift

+ '[' -e /etc/init.d/../conf.d/hwclock ']'

+ . /etc/init.d/../conf.d/hwclock

++ clock=UTC

++ clock_hctosys=YES

++ clock_args=

+ unset _conf_d

+ sourcex -e /etc/rc.conf

+ '[' -e = -e ']'

+ shift

+ '[' -e /etc/rc.conf ']'

+ . /etc/rc.conf

++ rc_shell=/sbin/sulogin

++ unicode=YES

++ rc_sys=

++ rc_tty_number=12

+ '[' Linux = Linux -a stop = start ']'

+ '[' -n '' ']'

+ sourcex /etc/init.d/hwclock

+ '[' /etc/init.d/hwclock = -e ']'

+ . /etc/init.d/hwclock

++ extra_commands='save show'

++ description='Sets the local clock to UTC or Local Time.'

++ description_save='Saves the current time in the BIOS.'

++ description_show='Displays the current time in the BIOS.'

++ :

++ :

++ :

++ : UTC

++ '[' UTC = UTC ']'

++ utc=UTC

++ utc_cmd=--utc

+ unset _d

+ unset _f

+ '[' -n '' ']'

+ '[' -n stop ']'

+ '[' stop = depend ']'

+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands' '$extra_stopped_commands'

+ '[' describe = stop ']'

+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands' '$extra_stopped_commands'

+ '[' start = stop ']'

+ for _cmd in describe start stop status '${extra_commands:-$opts}' '$extra_started_commands' '$extra_stopped_commands'

+ '[' stop = stop ']'

++ command -v stop

+ '[' stop = stop ']'

+ yesno

+ '[' -z '' ']'

+ return 1

+ unset _cmd

+ case $1 in

+ verify_boot

+ '[' '!' -e /run/openrc/softlevel ']'

+ return 0

++ command -v stop_pre

+ '[' '' = stop_pre ']'

+ stop

+ '[' -n '' ']'

+ yesno YES

+ '[' -z YES ']'

+ case "$1" in

+ return 0

+ local retval=0 errstr=

+ setupopts

+ case "$(uname -m)" in

++ uname -m

+ '[' -e /proc/devices ']'

+ grep -q ' cobd$' /proc/devices

+ case "$utc" in

+ '[' -z --utc ']'

+ ebegin 'Setting hardware clock using the system clock' '[UTC]'

 * Setting hardware clock using the system clock [UTC] ...

+ yesno

+ '[' -z '' ']'

+ return 1

+ LC_ALL=C

+ hwclock --help

+ grep -q '\-\-noadjfile'

+ utc_cmd='--utc --noadjfile'

+ _hwclock --systohc --utc --noadjfile

++ hwclock --systohc --utc --noadjfile

+ local 'err=hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.'

+ '[' -z 'hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.' ']'

+ echo 'hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.'

hwclock: Cannot access the Hardware Clock via any known method.

hwclock: Use the --debug option to see the details of our search for an access method.

+ return 1

+ retval=1

+ eend 1 'Failed to sync clocks'

 * Failed to sync clocks                                                                                      [ !! ]

+ exit 1

 * ERROR: hwclock failed to stop

gb6-netsvr01 ~ #

```

This Gentoo install is on a VMWare box.

/etc/conf.d/hwclock

```
# Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as

# Greenwich Mean Time).  If that clock is set to the local time, then

# set CLOCK to "local".  Note that if you dual boot with Windows, then

# you should set it to "local".

clock="UTC"

# If you want the hwclock script to set the system time (software clock)

# to match the current hardware clock during bootup, leave this

# commented out.

# However, you can set this to "NO" ifyou are running a modern kernel

# with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.

clock_hctosys="YES"

# If you do not want to set the hardware clock to the current system

# time (software clock) during shutdown, set this to no.

#clock_systohc="YES"

# If you wish to pass any other arguments to hwclock during bootup,

# you may do so here. Alpha users may wish to use --arc or --srm here.

clock_args=""

```

Any you guys help ?

----------

## druggo

try 

```
hwclock --debug 
```

----------

## psofa

do you use genkernel?If so, genkernel default config is broken since god knows when.

You can fix it by adding --menuconfig to your genkernel call and add manually the rtc support

----------

## slugggerzzz

Hmm, yer that sounds about right, i dont have this problem at home, build a custom kernel, but i am on all boxes at work, where ive used genkernel. 

I think i might just build a proper kernel. 

thanks guys.

----------

