openSUSE Forums > Install/Boot/Login » Launching a NTP server

Go Back   openSUSE Forums > Install/Boot/Login
Forums FAQ Members List Search Today's Posts Mark Forums Read

Install/Boot/Login Questions about installation, login, boot issues, partitioning, file systems, software that runs at boot (GRUB, LILO, boot scripts)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 21-Jun-2009, 07:35
Student Penguin
 
Join Date: Oct 2008
Location: Switzerland
Posts: 66
Gian-Piero hasn't been rated much yet
Default Launching a NTP server

I have installed on my PC an Expert mouseClock (Gude elektronik) receiving the time radio signal of DCF77 in Germany. It is functioning perfectly. My problem is the following: how do I start this service as root at boot?
I have written the following script in a file called ntpd in the /etc/init.d folder:
Quote:
#!/bin/bash
/usr/local/bin/ntpd
then I have made it executable:
Quote:
chmod 755 ntpd
I have seen that this file was copied in /etc/rc.d.
Then when I launch my system, this service is not started and I get the following line in the file /var/log/messages:
Quote:
Jun 21 14:02:01 Piantino-8 ntpd[4219]: ntpd 4.2.4@1.1437 Thu Jun 4 14:04:29 UTC 2009 (1)
Jun 21 14:02:01 Piantino-8 ntpd[4219]: ntpd: must be run as root, not uid 1000
How do I manage to run it as root?
Thank you in advance for your answer
Reply With Quote
  #2 (permalink)  
Old 21-Jun-2009, 08:21
AndreasStieger's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 275
AndreasStieger hasn't been rated much yet
Default Re: Launching a NTP server

Gian-Piero wrote:
> I have installed on my PC an Expert mouseClock (Gude elektronik)
> receiving the time radio signal of DCF77 in Germany. It is functioning
> perfectly. My problem is the following: how do I start this service as
> root at boot?
> I have written the following script in a file called ntpd in the
> /etc/init.d folder:
>> #!/bin/bash
>> /usr/local/bin/ntpd
>>

> then I have made it executable:
>> chmod 755 ntpd

> I have seen that this file was copied in /etc/rc.d.
> Then when I launch my system, this service is not started and I get the
> following line in the file /var/log/messages:
>> Jun 21 14:02:01 Piantino-8 ntpd[4219]: ntpd 4.2.4@1.1437 Thu Jun 4
>> 14:04:29 UTC 2009 (1)
>> Jun 21 14:02:01 Piantino-8 ntpd[4219]: ntpd: must be run as root, not
>> uid 1000

> How do I manage to run it as root?
> Thank you in advance for your answer
>


chkconfig
insserv

But why don't you just have the system ntpd use your clock?
Configue it in /etc/ntpd.conf,
/etc/init.d/ntp start
chkconfig -a ntp
I doubt that you need your own ntpd.

Kind regards,
Andreas Stieger
Reply With Quote
  #3 (permalink)  
Old 21-Jun-2009, 08:40
Student Penguin
 
Join Date: Oct 2008
Location: Switzerland
Posts: 66
Gian-Piero hasn't been rated much yet
Default Re: Launching a NTP server

Thank you for your answer.
But the clock has to be run by a special package and the manufacturer insists on the fact that no other ntp distributions (e.g. suse rpms, debian packages) is installed.
Kind regards.
Reply With Quote
  #4 (permalink)  
Old 21-Jun-2009, 11:46
AndreasStieger's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 275
AndreasStieger hasn't been rated much yet
Default Re: Launching a NTP server

Gian-Piero wrote:
> But the clock has to be run by a special package and the manufacturer
> insists on the fact that no other ntp distributions (e.g. suse rpms,
> debian packages) is installed.


In that case you can of yourse use your special ntpd and copy/adjust the
init script from the distribution package. Alternatively, copy and
adjust the fully documented /etc/init.d/skeleton to create your own
automatically started start/stoppable ntp service.

Kind regards,
Andreas Stieger
Reply With Quote
  #5 (permalink)  
Old 22-Jun-2009, 04:46
Student Penguin
 
Join Date: Oct 2008
Location: Switzerland
Posts: 66
Gian-Piero hasn't been rated much yet
Default Re: Launching a NTP server

Thank you for your answer.
I have found the following script in the distribution package:
Quote:
#! /bin/bash

case "$1" in
start)
echo -n "Starting ntpd "
/usr/local/bin/ntpd
echo -e " done"
;;
stop)
echo -n "Shutting down ntpd:"
killall /usr/local/bin/ntpd
echo -e " done"
;;
reload|restart)
$0 stop && $0 start
;;
status)
echo -n "Checking for service ntpd: "
checkproc /usr/local/bin/ntpd && echo OK || echo No process
;;
*)
echo "Usage: $0 {start|stop|status|reload|restart}"
exit 1
esac
I have put it in /etc/init.d and made it executable.
Now I can see the service ntpd in Yast2, but its activity is " No* " (I hope my translation is correct because my version of openSUSE 11.1 is in French).
This service is always not started at boot, because it requires root access.
I can start it manually from within Yast2 or from a terminal as root.
My problem still is: how can I manage to start this service as root automatically?
As I am far from being a specialist can you tell me what I have to do?

Kind regards

Last edited by Gian-Piero; 22-Jun-2009 at 04:47. Reason: missing details
Reply With Quote
  #6 (permalink)  
Old 22-Jun-2009, 05:54
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Launching a NTP server

You have to put a whole bunch of metadata in significant comments at the top of the file to make it installable into openSUSE's SysV init system using insserv or chkconfig. See /etc/init.d/skeleton for an example and documentation.
Reply With Quote
  #7 (permalink)  
Old 23-Jun-2009, 04:37
Student Penguin
 
Join Date: Oct 2008
Location: Switzerland
Posts: 66
Gian-Piero hasn't been rated much yet
Default Re: Launching a NTP server

Thank you for your help. I will try.
Regards
Reply With Quote
  #8 (permalink)  
Old 27-Jun-2009, 07:47
Student Penguin
 
Join Date: Oct 2008
Location: Switzerland
Posts: 66
Gian-Piero hasn't been rated much yet
Default Re: Launching a NTP server

After some trials and errors, I succeeded.
Thank you.
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2