From 631b830a092370f0dfc792bcdb0801a163a82177 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas <634494+krishnasrinivas@users.noreply.github.com> Date: Wed, 3 Jun 2020 22:45:47 -0700 Subject: [PATCH] Instructions to setup as systemd service (#30) --- systemd-service/README.md | 34 ++++++++++++++++++++++++++++++++ systemd-service/sidekick.service | 28 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 systemd-service/README.md create mode 100644 systemd-service/sidekick.service diff --git a/systemd-service/README.md b/systemd-service/README.md new file mode 100644 index 0000000..359081e --- /dev/null +++ b/systemd-service/README.md @@ -0,0 +1,34 @@ +# Systemd service for Sidekick + +Systemd script for Sidekick Load Balancer. + +## Installation + +- Systemd script is configured to run the binary from /usr/local/bin/ +- Download the binary from https://github.com/minio/sidekick/releases + +## Create default configuration + +```sh +$ cat <> /etc/default/sidekick +# Sidekick options +SIDEKICK_OPTIONS="--health-path=/minio/health/ready --address :8000" + +# Sidekick sites +SIDEKICK_SITES="http://172.17.0.{11...18}:9000 http://172.18.0.{11...18}:9000" + +EOF +``` + +## Systemctl + +Download sidekick.service in /etc/systemd/system/ + +## Enable startup on boot + +``` +systemctl enable sidekick.service +``` + +## Note +Replace User=nobody and Group=nobody in minio.service file with your local setup user. diff --git a/systemd-service/sidekick.service b/systemd-service/sidekick.service new file mode 100644 index 0000000..d191a0c --- /dev/null +++ b/systemd-service/sidekick.service @@ -0,0 +1,28 @@ +[Unit] +Description=Sidekick +Documentation=https://github.com/minio/sidekick/blob/master/README.md +Wants=network-online.target +After=network-online.target +AssertFileIsExecutable=/usr/local/bin/sidekick + +[Service] +User=nobody +Group=nogroup + +EnvironmentFile=/etc/default/sidekick + +ExecStart=/usr/local/bin/sidekick $SIDEKICK_OPTIONS $SIDEKICK_SITES + +# Let systemd restart this service always +Restart=always + +# Specifies the maximum file descriptor number that can be opened by this process +LimitNOFILE=65536 + +# Disable timeout logic and wait until process is stopped +TimeoutStopSec=infinity +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target +