Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 503042

Summary: sys-power/hibernate-script-2.0-r6 stops unrelated services on suspend
Product: Gentoo Linux Reporter: v1ne2go
Component: [OLD] Core systemAssignee: Alon Bar-Lev (RETIRED) <alonbl>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: A patch that solves the problem

Description v1ne2go 2014-02-28 13:30:53 UTC
If you activate "SaveClock yes" in /etc/hibernate/common.conf and have services installed that depend on the "clock" service, they are also stopped during suspend, but not restarted afterwards.
This might only apply to systems using OpenRC, which I use (sys-apps/openrc-0.12.4).
In my case, this affects fcron:
# /etc/init.d/hwclock -Z stop
 * stop: fcron hwclock
#

I expect only hwclock to be stopped.

Reproducible: Always

Steps to Reproduce:
1. Use OpenRC, install fcron and hibernate-script
2. Activate "SaveClock yes" in /etc/hibernate/common.conf
2. ps ax -> fcron runs
4. # hibernate
5. resume your system
6. ps ax -> no fcron runs
Actual Results:  
fcron is stopped and remains stopped

Expected Results:  
fcron keeps on running.

I fixed this by ignoring hwclock's dependencies when stopping it, see the attached patch.
Comment 1 v1ne2go 2014-02-28 13:31:26 UTC
Created attachment 371428 [details, diff]
A patch that solves the problem
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2014-02-28 19:53:29 UTC
Hi,

Can you please checkout the following instead:

+           /etc/init.d/hwclock save > /dev/null 2>&1

and:

+           /etc/init.d/hwclock restart > /dev/null 2>&1

BTW: on recent kernels it is better to configure CONFIG_RTC_HCTOSYS than using this option.
Comment 3 v1ne2go 2014-03-26 12:21:04 UTC
This change also works for me.
Thank you for looking at it!

As suggested, I will be switching to clock_hctosys="NO" in the future. Thank you for the hint.