savestate kills ntpd ??

Discussions about using Linux guests in VirtualBox.
Post Reply
greenbox
Posts: 9
Joined: 5. Oct 2009, 20:20
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: archlinux / ubuntu / winxp

savestate kills ntpd ??

Post by greenbox »

I have a vm running Archlinux in console mode, ntpd is included as daemon and started during boot.
I close it daily by savestate when poweroff the hosting pc.
When I open it again by startvm next day, ntpd is no longer running!?
Interestingly, it does not happen on vsftpd.
Any idea why this is so happening?
And, what is the best way to resolve it?
Thanks a lot for your suggestion/advice/help.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: savestate kills ntpd ??

Post by fixedwheel »

man ntpd ;)
OPTIONS
...
-g Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options.
greenbox
Posts: 9
Joined: 5. Oct 2009, 20:20
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: archlinux / ubuntu / winxp

Re: savestate kills ntpd ??

Post by greenbox »

Thanks fixedwheel.

I google "ntp.conf panicgate" and find that the -g option is not available in ntp.conf together with other ideas like "patch code oneself" "pass option on a fake command" "a nanny script to watch ntpd". On the other hand, FreeBSD man page say that simply adding "panic 0" to ntp.conf can do it. I am still testing it and will report back result later.
greenbox
Posts: 9
Joined: 5. Oct 2009, 20:20
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: archlinux / ubuntu / winxp

Re: savestate kills ntpd ??

Post by greenbox »

Things are getting strange.

At the beginning of my test, I find that the -g option looks already running by default as revealed by the output of "ps aux".
[root@myhost ~]# ps aux | grep ntp
root 802 0.0 0.6 4652 1692 ? Ss 13:21 0:00 /usr/bin/ntpd -g
As I am not sure if they are the same "-g", so I created a new Archlinux vm to do the test in parallel.

Today, when I open both vm's, I find that the ntpd is still alive on both vm and both clocks are delayed by about 8 hrs. (so, my first question "savestate kills ntpd" is not the real/only problem)

I left both vm's alone and after an hour, I find that the clock of the newly created vm is updated! :? while my working server is still not. :cry:

During those readings, seems that large portion of materials are about setting ntpd server. I don't need and can't handle them. Would you mind giving me some more hints to move on?
greenbox
Posts: 9
Joined: 5. Oct 2009, 20:20
Primary OS: Debian Lenny
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: archlinux / ubuntu / winxp

Re: savestate kills ntpd ??

Post by greenbox »

Latest update is:
Just find that the ntpd daemon on my working vm vanishes itself :shock: ?

Practically, I can write a script to check if ntpd is running, and run this script every hour. If it is there, restart it; if it is not, start it.

However, for learning purpose, I hope I can do it more decently from within ntp.
ntpd server is currently not my priority and seems to me that it is a large and complicated topic, so, hope experienced you's can give me some hints so that I don't need to go into details before knowing that they are about the server side or jump too fast and miss the answer I need. :oops:

Many thanks,
Post Reply