Re: [opensuse] hibernate preventing run of cron.daily; how to solve this?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Content-ID: <alpine.LNX.2.00.1305121613100.31424@Telcontar.valinor> El 2013-05-12 a las 12:26 +0200, Julien Michielsen escribió: You replied to me in private. I asume this is just a simple mistake because you are not used to these lists, so I'm replying back to the mail list.
Carlos E. R. schreef op 2013-05-11 19:05:
On Saturday, 2013-05-11 at 16:00 +0200, Julien Michielsen wrote:
Considering on Linux terms I do not really know what to do, I will not try to do this. What I did do is making a two-character alias (jd), which runs my juldaily script (runs my backup and sets my clock properly). Typing these two characters does everything I want to be done, and is easy enough for me.
You really need do nothing, it is automatic, your backup script will eventually run automatically, but not at the time you thought. You can improve things: Edit the file "/etc/sysconfig/cron", these two entries: DAILY_TIME="22:10" MAX_NOT_RUN="1" The firt line chooses a preferred time for the job to run. The second one means that if a day has passed without running (because the computer was off at that time) it will run within 15 minutes of booting or restoring. So, it ends by running once every day. Now, you say your clock is wrong at boot time, and that you run a script that sets your clock right. Ok, This can also be automated. Simply create a script in "/etc/pm/sleep.d/" and it will run at the correct time. For example, I have this script named "1cosas" (there can be several scripts, the number in front is for choosing which one runs first): +++·········································· #!/bin/bash . /usr/lib/pm-utils/functions NUM=1 DATE=`date --rfc-3339=seconds` case "$1" in hibernate) /bin/logger -t pm-utils -p syslog.warn "Hibernating ($NUM)..." echo "$DATE - hibernating the system now" >> /var/log/eventlog ;; suspend) /bin/logger -t pm-utils -p syslog.warn "Suspending ($NUM)..." echo "$DATE - suspending the system now" >> /var/log/eventlog ;; thaw) /bin/logger -t pm-utils -p syslog.warn "Thawing ($NUM)..." echo "$DATE - thawing the system now" >> /var/log/eventlog ;; resume) /bin/logger -t pm-utils -p syslog.warn "Resuming ($NUM)..." echo "$DATE - resuming the system now" >> /var/log/eventlog ;; *) ;; esac exit $? ··········································++- This script does nothing important, just writes an entry to syslog when the system is changing state, and another entry to a file: 2013-03-15 15:50:32+01:00 - Booting the system now ================================================================================ Linux Telcontar 3.1.10-1.19-desktop #1 SMP PREEMPT Mon Feb 25 10:32:50 UTC 2013 (f0b13a3) x86_64 x86_64 x86_64 GNU/Linux 2013-03-16 02:51:16+01:00 - hibernating the system now 2013-03-16 13:02:22+01:00 - thawing the system now 2013-03-16 18:51:58+01:00 - hibernating the system now so that I know when my computer was booted (that's another script) or hibernated or restored. In your case, you simply have to do whatever you do to restore your clock, write it in the correct section of the script. In fact, there is a file at "/usr/lib/pm-utils/sleep.d/90clock" that attempts it, perhaps it is failing in your case. Or, looking at it contents, you need setting the variable "NEED_CLOCK_SYNC" to true.. Try editing the file "/usr/lib/pm-utils/defaults", there is this section: +++·········································· # If you need to synchronize the system clock across a suspend/resume or # hibernate/thaw cycle, set this variable. # NEED_CLOCK_SYNC="true" ··········································++- remove the '#' in front of the variable. If that does not work, I still have more amunition ;-) - -- Saludos Carlos E. R. (desde 12.1 x86_64 "Asparagus" en Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlGPqucACgkQtTMYHG2NR9VyRwCfVe3sydty2iVIG+78VjgC+XWu BaAAn0bDB7kOjbZ9DUJzYB5pzQamboKK =f6fE -----END PGP SIGNATURE-----
El 12/05/13 10:44, Carlos E. R. escribió:
In fact, there is a file at "/usr/lib/pm-utils/sleep.d/90clock" that attempts it, perhaps it is failing in your case. Or, looking at it contents, you need setting the variable "NEED_CLOCK_SYNC" to true..
Try editing the file "/usr/lib/pm-utils/defaults", there is this section:
+++·········································· # If you need to synchronize the system clock across a suspend/resume or # hibernate/thaw cycle, set this variable. # NEED_CLOCK_SYNC="true" ··········································++-
remove the '#' in front of the variable. If that does not work, I still have more amunition ;-)
If you saw the comment it says "Modern kernels handle this correctly so we skip this hook by default" So I suggest you not to do that, it will probably make things worst, pm-utils is full of hacks whose necessity is questionable and will go away. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2013-05-12 at 13:02 -0400, Cristian Rodríguez wrote:
El 12/05/13 10:44, Carlos E. R. escribió:
If you saw the comment
it says "Modern kernels handle this correctly so we skip this hook by default"
So I suggest you not to do that, it will probably make things worst, pm-utils is full of hacks whose necessity is questionable and will go away.
I did not see that comment today, but I remember reading it in the past, and I agree. However, for some reason, the OP poster claims that his computer sows the wrong time after recovering from hibernation, and that he issues a command running a script to correct it, manually, every time the computer recovers (it is on his second post). So it is workth investigating if that hack works for him. In fact, my clock shows wrong time on restore, apparently. I have been unable to verify fully. While the computer recovers, before the screensaver kicks in, I can see that the time applets (gkrelm and xfce) displays the wrong time. After I enter the password on the screen saver, the time is correct, but several seconds have passed. There may be several explanations for this. One, is that when the screen first displays the applications have not had time to query the kernel for the time, or to redraw, or have not noticed yet it has changed, or the kernel is bussy recovering applications from swap so that the system is not fully functional. Another explanation is that I have a hack of my own: I stop and restart network on hibernation (I no longer remember why, perhaps because I had a bug related to this), and also I stop and restart the ntp time daemon, which obviously can change the clock. Yes, pm-utils is full of hacks, but I assure you that many of us have to use some of those hacks. Not everybody, not every hack, but some. - -- Cheers, Carlos E. R. (from 12.1 x86_64 "Asparagus" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEARECAAYFAlGQEPoACgkQtTMYHG2NR9VNCwCeNS30Scp0KueaT3CHBIjLJFjv yd0An0oyHuQHeIXArbzigdmoIlHlgGiP =2ngc -----END PGP SIGNATURE-----
participants (2)
-
Carlos E. R.
-
Cristian Rodríguez