[systemd-devel] Antw: Re: Unexplainable unit restart ("Start request repeated too quickly")
Michael Chapman
mike at very.puzzling.org
Mon Jun 3 09:39:39 UTC 2019
On Mon, 3 Jun 2019, Ulrich Windl wrote:
[...]
> Hi!
>
> The generator unit is:
> [Unit]
> Description=I/O performance monitor instance generator
> Documentation=man:iotwatch-generator(8) man:iotwatch at .service(8)
> Wants=nss-user-lookup.target time-sync.target paths.target
> After=nss-user-lookup.target time-sync.target paths.target
> ConditionPathExists=/etc/iotwatch.conf
> Conflicts=shutdown.target
>
> [Service]
> Type=oneshot
> ExecStart=/usr/lib/iotwatch/iotwatch-generator /run/systemd/system
> TimeoutStartSec=10
> RestartPreventExitStatus=2 3 4 5
> StartLimitBurst=1
>
> [Install]
> WantedBy=default.target iotwatch.target
That looks fine, though it _might_ make sense for it to have
RemainAfterExit= turned on. After all, if default.target or
iotwatch.target get restarted for any reason, then this unit will be
started again.
It's very weird to have what appears to be a generator done as a service
though. Any idea why that might be the case?
> The iotwatch.target is:
> [Unit]
> Description=iotwatch I/O performance monitor
> Documentation=man:iotwatch at .service(8) man:iotwatch-generator(8)
> After=nss-lookup.target time-sync.target paths.target
> Wants=iotwatch at NFS1.service iotwatch at NFS2.service iotwatch at LOC1.service
>
> [Install]
> WantedBy=default.target
>
> and the instance services look like:
> # automatically generated by /usr/lib/iotwatch/iotwatch-generator
>
> [Unit]
> Description=iotwatch I/O performance monitor instance "LOC1"
> Documentation=man:iotwatch(1) man:iotwatch at .service(8)
> SourcePath=/etc/iotwatch.conf
> PartOf=iotwatch.target
That also seems to imply that starting and stopping iotwatch.target would
be something that happens with some regularity.
> Requires=iotwatch-generator.service
> Wants=nss-user-lookup.target time-sync.target paths.target
> After=iotwatch-generator.service
> After=nss-user-lookup.target time-sync.target paths.target
> ConditionPathExists=/etc/passwd
> Conflicts=shutdown.target
>
> [Service]
> Type=forking
> RuntimeDirectory=iotwatch-LOC1
> WorkingDirectory=/var/run/iotwatch-LOC1
> ExecStartPre=/bin/sh -c '...'
> ExecStart=@/var/run/iotwatch-LOC1/iotwatch-LOC1 iotwatch-LOC1 -l ...
> /etc/passwd
> ExecStartPost=/usr/bin/sleep 0.2
> TimeoutStartSec=10
> ExecStop=/var/run/iotwatch-LOC1/iotwatch-LOC1 -l ...
> #SyslogIdentifier=%p-LOC1
> TimeoutStopSec=30
> PIDFile=/var/run/iotwatch-LOC1/iotwatch-LOC1.pid
> Restart=always
> RestartSec=10s
> RestartPreventExitStatus=1
> StartLimitBurst=1
>
> [Install]
> WantedBy=iotwatch.target
>
> >
> > It might also be good to know the RequiredBy, WantedBy, TriggeredBy,
> > RequisiteOf and PartOf properties of this iotwatch-generator.service (see
> > `systemctl show iotwatch-generator.service`), since they're possible ways
> > in which the service may be implicitly started or restarted.
>
> Yes, but I'm missing a log message that explains what happened.
Sure, there isn't one. That's why I'm asking about the properties.
More information about the systemd-devel
mailing list