Discussion:
is such a 'failed' state?
(too old to reply)
lejeczek
2021-03-28 19:19:13 UTC
Permalink
Hi guys.

I have a service (which for some reason, I suspect SELinux,
does not start at boot) which reports as:

-> $ systemctl status -l lsyncd | cat
● lsyncd.service - Live Syncing (Mirror) Daemon
   Loaded: loaded (/usr/lib/systemd/system/lsyncd.service;
enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/lsyncd.service.d
           └─override.conf
   Active: inactive (dead) since Sun 2021-03-28 15:01:16
EDT; 8min ago
 Main PID: 922 (code=exited, status=0/SUCCESS)

Mar 28 15:01:16 c8kubernode2.private.pawel systemd[1]:
Started Live Syncing (Mirror) Daemon.
Mar 28 15:01:16 c8kubernode2.private.pawel lsyncd[922]:
15:01:16 Normal: --- Startup, daemonizing ---
Mar 28 15:01:16 c8kubernode2.private.pawel lsyncd[922]:
15:01:16 Normal: --- Startup, daemonizing ---
Mar 28 15:01:16 c8kubernode2.private.pawel lsyncd[981]:
Normal, --- TERM signal, fading ---
Mar 28 15:01:16 c8kubernode2.private.pawel systemd[1]:
lsyncd.service: Succeeded.

and the service has:
[Service]
Restart=on-failure
RestartSec=30
TimeoutSec=30

I expected systemd to restart the service but that does not
happen. Services restarts okey with manual intervention.
Is it because service, even though it's not running, is not
really in 'failed' state or root cause is something else?

many thanks, L.
Reindl Harald
2021-03-28 19:26:31 UTC
Permalink
I have a service (which for some reason, I suspect SELinux, does not
-> $ systemctl status -l lsyncd | cat
● lsyncd.service - Live Syncing (Mirror) Daemon
   Loaded: loaded (/usr/lib/systemd/system/lsyncd.service; enabled;
vendor preset: disabled)
  Drop-In: /etc/systemd/system/lsyncd.service.d
           └─override.conf
   Active: inactive (dead) since Sun 2021-03-28 15:01:16 EDT; 8min ago
 Main PID: 922 (code=exited, status=0/SUCCESS)
Mar 28 15:01:16 c8kubernode2.private.pawel systemd[1]: Started Live
Syncing (Mirror) Daemon.
--- Startup, daemonizing ---
--- Startup, daemonizing ---
Mar 28 15:01:16 c8kubernode2.private.pawel lsyncd[981]: Normal, --- TERM
signal, fading ---
Succeeded.
[Service]
Restart=on-failure
RestartSec=30
TimeoutSec=30
I expected systemd to restart the service but that does not happen.
Services restarts okey with manual intervention.
Is it because service, even though it's not running, is not really in
'failed' state or root cause is something else?
post the complete unit file
you don't even show us the Type

do you have an [Install] section with a active traget to begin with?
lejeczek
2021-03-28 20:35:20 UTC
Permalink
Post by Reindl Harald
Post by lejeczek
I have a service (which for some reason, I suspect
-> $ systemctl status -l lsyncd | cat
● lsyncd.service - Live Syncing (Mirror) Daemon
    Loaded: loaded
(/usr/lib/systemd/system/lsyncd.service; enabled; vendor
preset: disabled)
   Drop-In: /etc/systemd/system/lsyncd.service.d
            └─override.conf
    Active: inactive (dead) since Sun 2021-03-28 15:01:16
EDT; 8min ago
  Main PID: 922 (code=exited, status=0/SUCCESS)
Started Live Syncing (Mirror) Daemon.
15:01:16 Normal: --- Startup, daemonizing ---
15:01:16 Normal: --- Startup, daemonizing ---
Normal, --- TERM signal, fading ---
lsyncd.service: Succeeded.
[Service]
Restart=on-failure
RestartSec=30
TimeoutSec=30
I expected systemd to restart the service but that does
not happen. Services restarts okey with manual intervention.
Is it because service, even though it's not running, is
not really in 'failed' state or root cause is something
else?
post the complete unit file
you don't even show us the Type
do you have an [Install] section with a active traget to
begin with?
Type=simple
EnvironmentFile=-/etc/sysconfig/lsyncd
...
[Install]
WantedBy=multi-user.target
Post by Reindl Harald
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Michael Biebl
2021-03-28 21:16:30 UTC
Permalink
Post by lejeczek
Main PID: 922 (code=exited, status=0/SUCCESS)
[..]
Post by lejeczek
Restart=on-failure
The service terminated with a zero exit code and you use Restart=on-failure.
A zero exit code is not treated as failure.

Loading...