LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   script for restarting ntpd in /home/user/.kde/autostart (https://www.linuxquestions.org/questions/fedora-35/script-for-restarting-ntpd-in-home-user-kde-autostart-391895/)

farpoint 12-12-2005 09:11 AM

script for restarting ntpd in /home/user/.kde/autostart
 
Hi. I'm having a problem with the ntp daemon dying when booting up FC2, or FC3 using planetccrma kernels. If I boot with the original kernel, for instance 2.6.5-1.358 on FC2, there are no problems, and I have no problem restarting the ntp daemon when using the planetccrma kernels. I have a script in /home/user/.kde/autostart, that somebody gave me for autoloading soundfonts in the Audigy2 soundcard using sfxload, that works fine, but I'm not sure what's needed in a script for running /etc/init.d/ntpd start . I did try a few options but without success. The daemon appears to be dying somewhere between the time it's showing as being started in the bootup sequence, and logging into KDE. Details below.

Path to ntpd: /usr/sbin/ntpd (shared library).
Main menu/services shows. "ntpd dead but pid file exists".
ps auxw shows the command for ntp, as being,
"ntpd -U ntp -p /var/run/ntpd.pid -g" , and is normally started after "xinetd -stayalive" , and before "/usr/sbin/vsftpd". This is obviously when booting with the original kernel. In the dead daemon scenario, ntpd doesn't show up at all in ps auxw.
Help with a script appreciated if possible. Nigel. aka farpoint.

PTrenholme 12-12-2005 09:59 AM

If you want something in "Autostart," you need a .desktop file. But that's quite easy to create: Just right-click on the KDE desktop, select "Create New->Application Link," and put the (executable) script you want to run in the "Application" box.

After you've tested the item on your desktop, just move it from the Desktop directory to the .kde/Autostart directory.

farpoint 12-12-2005 01:46 PM

Hi. I'm not having much success here. No problem creating the link to application, as I've done that before for music apps with no menu entries, but I'm concerned about the command "/etc/init.d/ntpd start" that I need to run, as this needs to be run as root. Trying it from the new desktop icon, it just returns a "KDEInit could not launch '/etc/init.d/ntpd start'".

I know this is going a bit OT, but this is the boot up situation with an NTP client accessing a server.

With the original kernel I get.
ntpd: Opening firewall for input from 192.168.0.228 port 123 [ OK ]
ntpd: Opening firewall for input from 192.168.0.230 port 123 [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]

But with the planetccrma kernels, and the third line, I get.
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
But this clearly dies shortly after starting, no doubt because of the failure to synch with the server, and yet there is no problem restarting the ntp daemon once logged into KDE.

Is there anyway to run a command that needs to run as root with .kde/autostart? Nigel. aka farpoint.


All times are GMT -5. The time now is 07:04 PM.