Last active
August 12, 2023 12:27
-
-
Save amitkhare/fc68c4fac3550a4908c807888ddef5d8 to your computer and use it in GitHub Desktop.
Systemd Service as USER start at Boot
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
[Unit] | |
Description=Service Description | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStartPre=/bin/sleep <TIME-IN-SECONDS> | |
User=<USER> | |
Group=<GROUP> | |
Restart=always | |
# Compose up | |
ExecStart=/usr/bin/podman-compose -f /opt/npm/docker-compose.yml up | |
# Compose down, remove containers and volumes | |
ExecStop=/usr/bin/podman-compose -f /opt/npm/docker-compose.yml down -v | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Above script should help start a user service at system boot
##Make Sure service has
WantedBy=default.target
otherwise it wont start at the bootThis service located at :
Reload Systemctl Deamon
Enable login linger for that user:
Start the Service
Enable the Service