add systemd service file

This commit is contained in:
Alfredo Garcia 2020-10-14 12:36:40 -03:00 committed by Deirdre Connolly
parent 49042c5f78
commit 2d3c3bcc23
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# Service file to run zebrad by systemd.
# Setup (Ubuntu/Debian) instructions:
# 1- Build the zebrad binary:
# cargo build -p zebrad --release
# 2- Copy/Move the built zebrad binary into your system binaries path:
# sudo cp target/release/zebrad /usr/bin
# 3- Replace AssertPathExists and ExecStart with the location of your binary if needed.
# 4- Place this file in systemd system folder, with the other systemd files:
# cp zebrad/systemd/zebrad.service /lib/systemd/system/
# 5- Start zebrad from systemd for the first time:
# systemctl start zebrad.service
# 6- Check status:
# systemctl status zebrad.service
# 7- Uninstall:
# systemctl stop zebrad.service
# rm /lib/systemd/system/zebrad.service
[Unit]
AssertPathExists=/usr/bin/zebrad
[Service]
ExecStart=/usr/bin/zebrad start
Restart=always
PrivateTmp=true
NoNewPrivileges=true
[Install]
Alias=zebrad
WantedBy=default.target