Only start a tomcat server when you are sure that time-sync.target is online

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

In our platform we have a dependency where we want to be sure that the
time-sync.target is online before we start our application servers. We
do this because we really want to be sure that the time on the
application server is in sync with our NTP servers. The downside of the
way we have done this at the moment is that making a configuration
change on ntp.conf results in a restart of ntpd, which in turn results
in a restart of the application servers. This is really not what we
want, because we actually want to be sure that the time is correct, and
a restart of the ntpd service on a server doesn't put the time on the
server at risk immediately.

Our current configuration looks roughly like this:

[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target time-sync.target
Requires=time-sync.target

[Service]
Type=simple
ExecStart=Startscripts
ExecStop=Stopscript
SuccessExitStatus=143
User=tomcatuser
Group=tomcatuser
Restart=on-failure

[Install]
WantedBy=multi-user.target


The problem line is the Requires line in there I think.

Does systemd give me a different way to check if the time is in sync?
Is there a way to create this dependency without implying a restart when
ntpd restarts?

Jan Hugo Prins


_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux