How to ensure a Ubuntu 16 systemd unit waits for ntpd to sync before starting?Systemd dependencies and boot orderVMWare Server flakiness on Ubuntu 9.10Not able to setup juggernaut push notification server on ubuntuinit.d script worked OK on Ubuntu 10.10 but not on 11.10 despite LBS header correctionHow to load the environment variables at boot time before X11 on Ubuntu Precise?pure-ftpd setup of pure-authd on Ubuntu (debian)Ubuntu 16.04 & Elasticsearch 1.7 - Startup ErrorRedis Sentinel Systemd services failing to start on Ubuntu 16.04 and CentOS 7Configuring MySQL to Listen for Remote Connections on UbuntuI get this error “Active: failed ” from the Process: 9666 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)?Disabling systemd messages that interfere with running BASH script
How badly should I try to prevent a user from XSSing themselves?
What exploit are these user agents trying to use?
How much of data wrangling is a data scientist's job?
What does it mean to describe someone as a butt steak?
How can I tell someone that I want to be his or her friend?
Assassin's bullet with mercury
Can I ask the recruiters in my resume to put the reason why I am rejected?
If human space travel is limited by the G force vulnerability, is there a way to counter G forces?
Can I make "comment-region" comment empty lines?
How to draw the figure with four pentagons?
Does a druid starting with a bow start with no arrows?
Neighboring nodes in the network
What to put in ESTA if staying in US for a few days before going on to Canada
In Romance of the Three Kingdoms why do people still use bamboo sticks when papers are already invented?
Why 'in' operator is throwing error instead of logging false with string literal
Fully-Firstable Anagram Sets
prove that the matrix A is diagonalizable
Increase size of symbol intercal when in superscript position
Has there ever been an airliner design involving reducing generator load by installing solar panels?
Anagram holiday
Is there a hemisphere-neutral way of specifying a season?
Reserved de-dupe rules
Did Shadowfax go to Valinor?
Is it possible to download Internet Explorer on my Mac running OS X El Capitan?
How to ensure a Ubuntu 16 systemd unit waits for ntpd to sync before starting?
Systemd dependencies and boot orderVMWare Server flakiness on Ubuntu 9.10Not able to setup juggernaut push notification server on ubuntuinit.d script worked OK on Ubuntu 10.10 but not on 11.10 despite LBS header correctionHow to load the environment variables at boot time before X11 on Ubuntu Precise?pure-ftpd setup of pure-authd on Ubuntu (debian)Ubuntu 16.04 & Elasticsearch 1.7 - Startup ErrorRedis Sentinel Systemd services failing to start on Ubuntu 16.04 and CentOS 7Configuring MySQL to Listen for Remote Connections on UbuntuI get this error “Active: failed ” from the Process: 9666 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)?Disabling systemd messages that interfere with running BASH script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
We have a service that starts at boot. We need to ensure it doesn't start until the system clock has been synchronized via ntp. The machines are using ntpd.
The machines are using ntpd and not systemd-timesyncd for doing timesync. Can someone let me know what pre-conditions I have to wait for in the unit file.
Below is the content of ntp.service
support@vrni-platform:/etc/init.d$ sudo systemctl cat ntp.service
# /run/systemd/generator.late/ntp.service
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/ntp
Description=LSB: Start NTP daemon
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
After=systemd-journald-dev-log.socket
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/ntp start
ExecStop=/etc/init.d/ntp stop
Below is a sample unit file which needs ntp sync
[Unit]
Description=Zookeeper Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStartPre=-/bin/mkdir -p /var/log/zookeeper
ExecStartPre=-/bin/chown zookeeper /var/log/zookeeper
ExecStartPre=-/bin/mkdir -p /var/run/zookeeper
ExecStartPre=-/bin/chown zookeeper:zookeeper /var/run/zookeeper
ExecStartPre=-/bin/bash /usr/bin/zookeeper-systemd-prestart.sh
ExecStartPre=-/bin/su zookeeper -s /bin/bash -c '/usr/bin/zookeeper-server start'
ExecStartPre=-/bin/sleep 3
ExecStart=/bin/bash /usr/bin/zookeeper-systemd-health.sh
ExecStopPost=-/bin/bash /usr/bin/zookeeper-systemd-poststop.sh
RestartSec=2s
Restart=always
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
ubuntu ubuntu-16.04
add a comment |
We have a service that starts at boot. We need to ensure it doesn't start until the system clock has been synchronized via ntp. The machines are using ntpd.
The machines are using ntpd and not systemd-timesyncd for doing timesync. Can someone let me know what pre-conditions I have to wait for in the unit file.
Below is the content of ntp.service
support@vrni-platform:/etc/init.d$ sudo systemctl cat ntp.service
# /run/systemd/generator.late/ntp.service
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/ntp
Description=LSB: Start NTP daemon
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
After=systemd-journald-dev-log.socket
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/ntp start
ExecStop=/etc/init.d/ntp stop
Below is a sample unit file which needs ntp sync
[Unit]
Description=Zookeeper Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStartPre=-/bin/mkdir -p /var/log/zookeeper
ExecStartPre=-/bin/chown zookeeper /var/log/zookeeper
ExecStartPre=-/bin/mkdir -p /var/run/zookeeper
ExecStartPre=-/bin/chown zookeeper:zookeeper /var/run/zookeeper
ExecStartPre=-/bin/bash /usr/bin/zookeeper-systemd-prestart.sh
ExecStartPre=-/bin/su zookeeper -s /bin/bash -c '/usr/bin/zookeeper-server start'
ExecStartPre=-/bin/sleep 3
ExecStart=/bin/bash /usr/bin/zookeeper-systemd-health.sh
ExecStopPost=-/bin/bash /usr/bin/zookeeper-systemd-poststop.sh
RestartSec=2s
Restart=always
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
ubuntu ubuntu-16.04
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago
add a comment |
We have a service that starts at boot. We need to ensure it doesn't start until the system clock has been synchronized via ntp. The machines are using ntpd.
The machines are using ntpd and not systemd-timesyncd for doing timesync. Can someone let me know what pre-conditions I have to wait for in the unit file.
Below is the content of ntp.service
support@vrni-platform:/etc/init.d$ sudo systemctl cat ntp.service
# /run/systemd/generator.late/ntp.service
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/ntp
Description=LSB: Start NTP daemon
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
After=systemd-journald-dev-log.socket
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/ntp start
ExecStop=/etc/init.d/ntp stop
Below is a sample unit file which needs ntp sync
[Unit]
Description=Zookeeper Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStartPre=-/bin/mkdir -p /var/log/zookeeper
ExecStartPre=-/bin/chown zookeeper /var/log/zookeeper
ExecStartPre=-/bin/mkdir -p /var/run/zookeeper
ExecStartPre=-/bin/chown zookeeper:zookeeper /var/run/zookeeper
ExecStartPre=-/bin/bash /usr/bin/zookeeper-systemd-prestart.sh
ExecStartPre=-/bin/su zookeeper -s /bin/bash -c '/usr/bin/zookeeper-server start'
ExecStartPre=-/bin/sleep 3
ExecStart=/bin/bash /usr/bin/zookeeper-systemd-health.sh
ExecStopPost=-/bin/bash /usr/bin/zookeeper-systemd-poststop.sh
RestartSec=2s
Restart=always
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
ubuntu ubuntu-16.04
We have a service that starts at boot. We need to ensure it doesn't start until the system clock has been synchronized via ntp. The machines are using ntpd.
The machines are using ntpd and not systemd-timesyncd for doing timesync. Can someone let me know what pre-conditions I have to wait for in the unit file.
Below is the content of ntp.service
support@vrni-platform:/etc/init.d$ sudo systemctl cat ntp.service
# /run/systemd/generator.late/ntp.service
# Automatically generated by systemd-sysv-generator
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/ntp
Description=LSB: Start NTP daemon
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
After=systemd-journald-dev-log.socket
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/ntp start
ExecStop=/etc/init.d/ntp stop
Below is a sample unit file which needs ntp sync
[Unit]
Description=Zookeeper Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStartPre=-/bin/mkdir -p /var/log/zookeeper
ExecStartPre=-/bin/chown zookeeper /var/log/zookeeper
ExecStartPre=-/bin/mkdir -p /var/run/zookeeper
ExecStartPre=-/bin/chown zookeeper:zookeeper /var/run/zookeeper
ExecStartPre=-/bin/bash /usr/bin/zookeeper-systemd-prestart.sh
ExecStartPre=-/bin/su zookeeper -s /bin/bash -c '/usr/bin/zookeeper-server start'
ExecStartPre=-/bin/sleep 3
ExecStart=/bin/bash /usr/bin/zookeeper-systemd-health.sh
ExecStopPost=-/bin/bash /usr/bin/zookeeper-systemd-poststop.sh
RestartSec=2s
Restart=always
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
ubuntu ubuntu-16.04
ubuntu ubuntu-16.04
edited 2 days ago
tuk
asked 2 days ago
tuktuk
16618
16618
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago
add a comment |
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961050%2fhow-to-ensure-a-ubuntu-16-systemd-unit-waits-for-ntpd-to-sync-before-starting%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961050%2fhow-to-ensure-a-ubuntu-16-systemd-unit-waits-for-ntpd-to-sync-before-starting%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of Systemd dependencies and boot order
– HBruijn
2 days ago
I don't think this is a duplicate question. I have edited my question.
– tuk
2 days ago