From 2d3c3bcc230e95e572f552a560c5927a17270a85 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 14 Oct 2020 12:36:40 -0300 Subject: [PATCH] add systemd service file --- zebrad/systemd/zebrad.service | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 zebrad/systemd/zebrad.service diff --git a/zebrad/systemd/zebrad.service b/zebrad/systemd/zebrad.service new file mode 100644 index 000000000..96d3e6023 --- /dev/null +++ b/zebrad/systemd/zebrad.service @@ -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