Last active
January 20, 2018 15:36
-
-
Save H0neyBadger/fc371492990af879c4c844fad3d4b6f0 to your computer and use it in GitHub Desktop.
Systemd custom production target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/clear_custom.service | |
[Unit] | |
Description=Clear custom lock | |
After=custom.target | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/rm /noprod | |
KillMode=process | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/custom.service | |
[Unit] | |
Description=Test service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/touch /tmp/test | |
KillMode=process | |
[Install] | |
WantedBy=custom.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/custom.target | |
[Unit] | |
Description=Custom target to manage user applications | |
Requires=multi-user.target | |
ConditionPathExists=!/noprod | |
Conflicts=rescue.service rescue.target | |
After=multi-user.target rescue.service rescue.target | |
AllowIsolate=no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment