Re: 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]

 





Am 25.03.21 um 14:41 schrieb Jan Hugo Prins:
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.

yes

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?
https://unix.stackexchange.com/questions/388586/systemd-requires-vs-wants

just replace "Requires" with "Wants", it does exactly the same but your Tomcat would also get started if "time-sync.target" is missing *but* it would not be stopped just because ntpd is stopped

there are really very few cases when Requires is really what someone wants
_______________________________________________
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