Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Tidy up metal-iptables.service
Browse files Browse the repository at this point in the history
Adds a `ExecCondition` that checks whether our `/etc/iptables/metal.conf` file exists before trying to start. This will more clearly state why the service failed instead of leaving the `ExecStart` command output to the user to interpret.

Alpha-sorts the properties.
  • Loading branch information
rustydb committed Aug 10, 2024
1 parent 68918aa commit 27e606e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ Description=Loads Metal iptables config
After=local-fs.target network.service

[Service]
Type=oneshot
ExecCondition=/bin/bash -c '[ -f /etc/iptables/metal.conf ]'
ExecStart=/usr/sbin/iptables-restore /etc/iptables/metal.conf
Restart=no
RemainAfterExit=no
Type=oneshot

[Install]
WantedBy=multi-user.target

0 comments on commit 27e606e

Please sign in to comment.