diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-19 01:28:09 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-19 01:28:09 +0000 |
commit | df8c8876bc245c6124dd4691e5a95d8f397ca152 (patch) | |
tree | fcfec66704123b58c286aab83af16ab1b5248a21 /examples/ROOT/img/services-network/ntpclient | |
parent | 90acd08f35f9691753fdd523c6970365b6ea4b73 (diff) | |
download | s6-df8c8876bc245c6124dd4691e5a95d8f397ca152.tar.xz |
Add examples/ subtree
Diffstat (limited to 'examples/ROOT/img/services-network/ntpclient')
4 files changed, 35 insertions, 0 deletions
diff --git a/examples/ROOT/img/services-network/ntpclient/README b/examples/ROOT/img/services-network/ntpclient/README new file mode 100644 index 0000000..c4fc357 --- /dev/null +++ b/examples/ROOT/img/services-network/ntpclient/README @@ -0,0 +1,9 @@ +This service updates the system clock via NTP every 4 hours. +If you're not in France, change 0.fr.pool.ntp.org to a NTP +server pool more fitting your location. +See www.ntp.pool.org for details. + +Do yourself a favor and don't rely on NTP internally. +Just synchronize your main time server via this NTP client +to the outside world, and use a saner and simpler protocol +like TAICLOCK in your internal, fast-speed network. diff --git a/examples/ROOT/img/services-network/ntpclient/log/README b/examples/ROOT/img/services-network/ntpclient/log/README new file mode 100644 index 0000000..e4c7a37 --- /dev/null +++ b/examples/ROOT/img/services-network/ntpclient/log/README @@ -0,0 +1,3 @@ +Yes, the output of the ntpclient service is logged to +the /var/log/ntpclient logdir. +Make sure it has the correct Unix credentials and permissions! diff --git a/examples/ROOT/img/services-network/ntpclient/log/run b/examples/ROOT/img/services-network/ntpclient/log/run new file mode 100755 index 0000000..261b534 --- /dev/null +++ b/examples/ROOT/img/services-network/ntpclient/log/run @@ -0,0 +1,4 @@ +#!/command/execlineb -P +s6-setuidgid ntplog +exec -c +s6-log -t /var/log/ntpclient diff --git a/examples/ROOT/img/services-network/ntpclient/run b/examples/ROOT/img/services-network/ntpclient/run new file mode 100755 index 0000000..7ade064 --- /dev/null +++ b/examples/ROOT/img/services-network/ntpclient/run @@ -0,0 +1,19 @@ +#!/command/execlineb -P + +fdmove -c 2 1 +if +{ + pipeline + { + s6-setuidgid ntp + backtick -n NTPSERVERIP + { + pipeline { s6-dnsip4 -t 16000 0.fr.pool.ntp.org. } + s6-head -n 1 + } + s6-sntpclock -v $NTPSERVERIP + } + s6-clockadd +} +s6-setuidgid nobody +s6-sleep 14400 |