Sorry we lost some posts because of database errors!

*New 12.1 series Release:
2020-09-01: XigmaNAS 12.1.0.4.7728 - released

*New 11.4 series Release:
2020-08-27: XigmaNAS 11.4.0.4.7718 - released!


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

NTPD setup

XigmaNAS Scripts and shell tips
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
alexey123
Moderator
Moderator
Posts: 1555
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

NTPD setup

#1

Post by alexey123 »

I made Xigmanas as Network Time server for my local network.

This is very simple

Xigmanas have binaries for run it, but not have configurator

In first I create folder for scripts and config, then I grab from jail files /etc/rc.d/ntpd and /etc/ntp.conf

I add to ntp.conf

Code: Select all

server time1.google.com iburst
server time2.google.com iburst
server time3.google.com iburst
server time4.google.com iburst

Code: Select all

restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
10.0.0.0/24 is my network
and

Code: Select all

logfile /var/log/ntp.log
Then I create startup script

Code: Select all

#!/bin/sh
# Start up switch for ntp daemon

ln -s /mnt/tank/app/ntp/ntp.conf /etc/ntp.conf
ln -s /mnt/tank/app/ntp/ntpd /etc/rc.d/ntpd


service ntpdate stop
rconf service disable ntpdate

rconf service enable ntpd
rconf attribute set ntpd_sync_on_start YES

service ntpd fetch
service ntpd start
Where /mnt/tank/app/ntp is path to homing ntp-folder

Define start script as postinit
That is all
Now I configure other computers receive time from Xigmanas IP.
As for me work perfect
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4968
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: NTPD setup

#2

Post by raulfg3 »

is not the same that enable on SMB?:
2.jpg
You do not have the required permissions to view the files attached to this post.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

User avatar
alexey123
Moderator
Moderator
Posts: 1555
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: NTPD setup

#3

Post by alexey123 »

No!
Built-in future work as client - Xigmanas check time at external server only.
ntpd workas daemon - it check external server and work as time server for LAN also.

Samba? may be it work as time of file create procedure.
In all case, you can check - scan ports at your NAS, port 123 must be open at fileserver

I make this future when I compile Xigmanas for raspberry pi3 - it not have cmos timer buitin

UPD
I add scan results for regular xigmanas server, used at my laboratory - Udp port 123 is closed
You do not have the required permissions to view the files attached to this post.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

btribley
NewUser
NewUser
Posts: 2
Joined: 16 Oct 2020 03:35
Status: Offline

Re: NTPD setup

#4

Post by btribley »

Thank you very much for this guide. It saved me a lot of time. However, some points for people new to XigmaNAS and FreeBSD (i.e. Linux admin refugees like me):
# This tutorial is intended for the Embedded version of the server. df reveals that /etc is on a ramdisk, so its contents disappear at reboot.
# You must not enable ntpd if you are running Samba AD as that includes NTPD configured a different way. The two methods will conflict.
# Note that an easy alternative to this is to install dnsmasq and tick the "NTP Server" box. Bingo, it will be up and running!
# Recent versions of XigmaNAS (I have 12.1.0.4.7743) don't have the ntpd rc.d script. You need to supply your own.
# The files presented need to be available on a persistent drive. I used a 250Gb flash drive, so the part of that drive that's not used for the embedded system is mounted on /mnt/sysflash .
# Because the system is embedded normally you can't modify startup with scripts. XigmaNAS provides a way to do this in the web interface. System->Advanced->Command Scripts . In here you need to install the script given in the post as a Postinit
Image
# Remember that the postinit and rc.d scripts must be owned by root and made executable.

Here's my cobbled-up, barley adequate ntpd script:

Code: Select all

#!/bin/sh

. /etc/rc.subr

name="ntpd"
start_cmd="${name}_start"
stop_cmd=":"

ntpd_start()
{
    /usr/sbin/ntpd
}

load_rc_config $name
run_rc_command "$1"
Here's what my directory looks like:

Code: Select all

xigmanas: ntpd# pwd
/mnt/sysflash/ntpd
xigmanas: ntpd# ll
total 12
-rw-r--r--  1 root  wheel  759 Oct 12 06:17 ntp.conf
-rwxr-xr-x  1 root  wheel  158 Oct 12 08:42 ntpd*
-rwxr-x---  1 root  wheel  300 Oct 12 14:00 ntpd_postinit.sh*
xigmanas: ntpd#
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Scripts and shell tips”