Discussion:
Q: asymmetry of ExecStop and ExecStart
(too old to reply)
Ulrich Windl
2021-04-14 10:34:54 UTC
Permalink
Hi!

I have two services defined, one using ExecStart only, the other ExecStop only.
Then I discovered some asymmetry:
systemd is still starting the service with the ExecStop only, while the one with the ExecStart only never is stopped.

Is that intended, or do I have some configuration error in the ExecStart only service?

The units look like this:
# /usr/lib/systemd/system/dellcd-log-start.service
[Unit]
Description=Log Start on Dell LCD
Documentation=man:dellcd(1)
DefaultDependencies=no
After=local-fs.target
Before=sysinit.target
Requires=local-fs.target
ConditionPathExists=/usr/bin/...

[Service]
Type=oneshot
TimeoutSec=10
ExecStart=/usr/bin/...

[Install]
WantedBy=sysinit.target

# /usr/lib/systemd/system/dellcd-log-stop.service
[Unit]
Description=Log Stop on Dell LCD
Documentation=man:dellcd(1)
DefaultDependencies=no
After=default.target
Requires=local-fs.target
ConditionPathExists=/usr/bin/...

[Service]
Type=oneshot
TimeoutSec=5
RemainAfterExit=yes
ExecStop=/usr/bin/...

[Install]
WantedBy=default.target

---
Regards,
Ulrich
Andrei Borzenkov
2021-04-14 10:41:59 UTC
Permalink
On Wed, Apr 14, 2021 at 1:35 PM Ulrich Windl
Post by Ulrich Windl
Hi!
I have two services defined, one using ExecStart only, the other ExecStop only.
systemd is still starting the service with the ExecStop only, while the one with the ExecStart only never is stopped.
Is that intended, or do I have some configuration error in the ExecStart only service?
# /usr/lib/systemd/system/dellcd-log-start.service
[Unit]
Description=Log Start on Dell LCD
Documentation=man:dellcd(1)
DefaultDependencies=no
After=local-fs.target
Before=sysinit.target
Requires=local-fs.target
ConditionPathExists=/usr/bin/...
[Service]
Type=oneshot
TimeoutSec=10
ExecStart=/usr/bin/...
Type=oneshot services go from "starting" directly to "dead"; they are
never active and so there is nothing to stop.
Post by Ulrich Windl
[Install]
WantedBy=sysinit.target
# /usr/lib/systemd/system/dellcd-log-stop.service
[Unit]
Description=Log Stop on Dell LCD
Documentation=man:dellcd(1)
DefaultDependencies=no
After=default.target
Requires=local-fs.target
ConditionPathExists=/usr/bin/...
[Service]
Type=oneshot
TimeoutSec=5
RemainAfterExit=yes
ExecStop=/usr/bin/...
[Install]
WantedBy=default.target
---
Regards,
Ulrich
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Mantas Mikulėnas
2021-04-14 11:11:20 UTC
Permalink
Post by Andrei Borzenkov
On Wed, Apr 14, 2021 at 1:35 PM Ulrich Windl
Post by Ulrich Windl
Hi!
I have two services defined, one using ExecStart only, the other
ExecStop only.
Post by Ulrich Windl
systemd is still starting the service with the ExecStop only, while the
one with the ExecStart only never is stopped.
Post by Ulrich Windl
Is that intended, or do I have some configuration error in the ExecStart
only service?
Post by Ulrich Windl
# /usr/lib/systemd/system/dellcd-log-start.service
[Unit]
Description=Log Start on Dell LCD
Documentation=man:dellcd(1)
DefaultDependencies=no
After=local-fs.target
Before=sysinit.target
Requires=local-fs.target
ConditionPathExists=/usr/bin/...
[Service]
Type=oneshot
TimeoutSec=10
ExecStart=/usr/bin/...
Type=oneshot services go from "starting" directly to "dead"; they are
never active and so there is nothing to stop.
Unless they have RemainAfterExit=yes. See e.g. nftables.service or
systemd-user-sessions.service.
--
Mantas Mikulėnas
Loading...