Note: The functionality of this program is now available in the ntpd(8)
program. See the -q command line option in the ntpd(8) page. After a
suitable period of mourning, the ntpdate utility is to be retired from
this distribution.
nptd_enable="YES"
and maybe add ntpd_sync_on_start="YES"
. Configure the time server in /etc/ntp.conf. The rc utility is the command script which controls the automatic boot
process after being called by init(8). The rc.local script contains
commands which are pertinent only to a specific site. Typically, the
/usr/local/etc/rc.d/ mechanism is used instead of rc.local these days but
if you want to use rc.local, it is still supported. In this case, it
should source /etc/rc.conf and contain additional custom startup code for
your system. The best way to handle rc.local, however, is to separate it
out into rc.d/ style scripts and place them under /usr/local/etc/rc.d/.
The rc.conf file contains the global system configuration information
referenced by the startup scripts, while rc.conf.local contains the local
system configuration. See rc.conf(5) for more information.
This is my first time using FreeBSD, can you please write me the code? I tried but I can't... This is what I put in /etc/rc.local but it doesn't work:You should probably stop using ntpdate(8), it will be deprecated in a future version.
Code:Note: The functionality of this program is now available in the ntpd(8) program. See the -q command line option in the ntpd(8) page. After a suitable period of mourning, the ntpdate utility is to be retired from this distribution.
That said, put the command in /etc/rc.local.
Just as SirDice mentioned: IF you just want a good date & time at boot, just add to /etc/rc.confI tried but I can't... This is what I put in /etc/rc.local but it doesn't work
ntpd_enable="YES"
ntpd_sync_on_start="YES" #sync time at startup in a big leap; after that gentle clock synchronization
Thanks cracauer@ for the advice, but nothing to do!Adding things to /etc/rc.local is generally working for this.
You lack error messages, so it is better to do this:
Code:/usr/sbin/ntpdate ntp.ien.it 2>&1 | tee /var/log/mystuff.log
Apart from using the ntpdate facility already built in
...
#
# To configure a specific server, such as an organization-wide local
# server, add lines similar to the following. One or more specific
# servers can be configured in addition to, or instead of, any server
# pools specified above. When both are configured, ntpd first adds all
# the specific servers, then adds servers from the pool until the tos
# minclock/maxclock targets are met.
#
#server time.my-internal.org iburst
server ntp.ien.it iburst
...
#-----------
# NTP daemon
ntpd_enable="YES"
ntpd_sync_on_start="YES"
Put a line into crontab(5) for root user starting withHi guys!
Since I can't do it in any way... Please, someone tell me how to load, at boot, with FreeBSD 14.2-RC1, a very simple script that contains:
#!/bin/sh
/usr/sbin/ntpdate ntp.ien.it
Thanks for the answer.
@reboot
.By far, the more sensible solution (given the stated problem) is to fix ntpd.conf (as it SHOULD be fixed to correspond to the actual $SITE) and let the existing rc mechanisms handle it as a "normal" system would.Put a line into crontab(5) for root user starting with@reboot
.