Skip to content

Commit

Permalink
Switch systemd units to use Type=exec instead of Type=oneshot
Browse files Browse the repository at this point in the history
`oneshot` is designed to be used with RemainAfterExit, but we don't need
that nor use it. After reviewing
<https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html>,
`exec` appears to be the correct type since we want the service to be
running once the binary has started, not once it's finished.

Practically this shouldn't make a big difference except that `systemctl
start <name>` won't wait for the entire command to complete.

Fixes #7349.
  • Loading branch information
legoktm committed Nov 22, 2024
1 parent 21ee737 commit a52e71a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Description=Cleanup OSSEC diff queue

[Service]
Type=oneshot
Type=exec
ExecStart=/usr/bin/securedrop-cleanup-ossec.py
User=root
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Description=Touch /var/run/reboot-required file

[Service]
Type=oneshot
Type=exec
ExecStart=/usr/bin/touch /var/run/reboot-required
User=root
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ConditionPathExists|=/usr/sbin/ufw
ConditionPathExists|=/usr/sbin/haveged

[Service]
Type=oneshot
Type=exec
Environment="DEBIAN_FRONTEND=noninteractive"
ExecStart=/usr/bin/apt-get purge --yes ufw haveged
User=root

0 comments on commit a52e71a

Please sign in to comment.