Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Created August 29, 2019 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdamjan/d64a73e675c6034e441cbc9bf441ddfb to your computer and use it in GitHub Desktop.
Save gdamjan/d64a73e675c6034e441cbc9bf441ddfb to your computer and use it in GitHub Desktop.
# /etc/systemd/system/custom.target
[Unit]
AllowIsolate=yes
sudo systemctl add-requires custom.target testA.service testB.service
sudo systemctl start custom.target
sudo systemctl stop testB
# /etc/systemd/system/testA.service
[Unit]
Description=test
PartOf=custom.target
[Service]
Type=simple
ExecStart=/bin/sleep infinity
PrivateDevices=yes
# /etc/systemd/system/testB.service
[Unit]
Description=test
PartOf=custom.target
[Service]
Type=simple
ExecStart=/bin/sleep infinity
PrivateDevices=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment