Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add a systemd service to the bash script #321

Open
Lyamc opened this issue May 4, 2021 · 0 comments
Open

Automatically add a systemd service to the bash script #321

Lyamc opened this issue May 4, 2021 · 0 comments

Comments

@Lyamc
Copy link

Lyamc commented May 4, 2021

A that would be needed is to add this to the script:

cat << SERVICE_CMD | sudo tee /etc/systemd/system/cloud-torrent.service
[Unit]
Description=Cloud Torrent System Daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/cloud-torrent
StandardOutput=append:/var/log/cloud-torrent.log
Restart=on-failure
RestartSec=3

[Install]
WantedBy=multi-user.target
SERVICE_CMD

This will spit out a ready-to-use service that only needs the user to run:

sudo systemctl enable --now cloud-torrent

Uninstall would be simple:

sudo systemctl disable --now cloud-torrent
sudo rm -f /etc/systemd/system/cloud-torrent.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant