0

I configured the service - calc_mem.service

as the following

Restart=on-failure
RestartSec=5
StartLimitInterval=400
StartLimitBurst=3

the configuration above should do the following

the service have 3 retries when service exit with error and before service start it will wait 5 seconds

also we want to update the /var/log/message about any retry from the service

for example

lets say we start the service , and service fail so it will try the first try , and on the first try service successfully started

is it possible to write the fail of service start to /var/log/message ?

note - we have redhat Linux machine version - 7.2

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
yael
  • 13,106
  • Hmm, what is in /var/log/messages already? Does it show "Starting" and "Started" lines for calc_mem.service? – sourcejedi Mar 22 '19 at 10:14
  • please edit to confirm your version number of RHEL or CentOS – sourcejedi Mar 22 '19 at 10:17
  • my redhat version is 7.2 – yael Mar 22 '19 at 10:19
  • I guess its show service started , but for sure its not show when its fail or not start correctly – yael Mar 22 '19 at 10:20
  • Thanks. I think you should edit to show what those messages look like. Then, what does the RHEL rsyslog.conf look like? I wonder if you see the messages in /var/log/error or /var/log/warn or something like that. – sourcejedi Mar 22 '19 at 10:37
  • As can be seen from https://unix.stackexchange.com/q/289629/5132 as just one example, this stuff is logged in the journal. This is really an rsyslog problem, not a systemd one. – JdeBP Mar 22 '19 at 12:04

0 Answers0