:: Re: [DNG] ntp setup
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Steve Litt
日付:  
To: dng
題目: Re: [DNG] ntp setup
o1bigtenor via Dng said on Sat, 19 Jun 2021 09:31:23 -0500

>Greetings
>
>Noticed that my new Beowulf install time was not accurate.
>
>Went looking for a tips page and all I could find was information
>relating to using systemd and or its tools to do such. I know there is
>a way to do this without systemd - - - - - just - - - its been a very
>long time since I've done that.
>
>Please - - - anyone for a short writeup on how to
>install/start/whatever else to ntp without using systemd?


Hi o1bigtenor,

I can speak for openntpd, because I use it with runit.

My runit system runs openntpd as follows:

exec openntpd -d ${OPTS:=-s} 2>&1

If you were going to run it on a terminal as root, the preceding would
simplify down to the following:

openntpd -d -s

In the preceding, -d means do not daemonize yourself (don't put
yourself in background, but instead run in foreground), and -s means
try to set the time immediately at startup.

As a first step, you can run the preceding command on a terminal
manually, and make sure everything's cool.

If you want to run it from sysvinit, I'm pretty sure you need to remove
the -d, because sysvinit expects daemons to put themselves in the
background (which is inferior). I don't know what you'd do about
logging in sysvinit, but I don't see a big need for logging a time
daemon anyway.

So you'd make an init script with the five verbs, what are they, start,
stop, restart, and two others, have each verb be a shellscript
function, have restart be stop;start, and don't worry about all the
nasty complications sysvinit init scripts throw in to accommodate
corner cases in the corners of corners. It should probably be about 30
lines at most.

As an alternative, you could start Runit's runsvdir in /etc/inittab,
and have runit supervise openntpd. Once you do that, you can do it for
lots of other services. In my opinion, runit is superior to sysvinit,
just like sysvinit is superior to systemd. And using sysvinit as PID1
and using runsvdir as your process supervisor is a VERY good way to do
things, I did it for years except I used daemontools instead of runit.
By the way, if you're interested in s6, you could substitute s6 for
runit.

Bottom line, openntpd has absolutely no dependency or interaction with
PID1 or anything systemd, at least not that I can see. So your wish
should be trivial to fulfill.

HTH,

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques