From 3e36c403979508d0647c2a27ca7cba6cd4ee862b Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 30 Sep 2024 11:28:03 +0200 Subject: [PATCH] add systemd service example --- docs/installation.mdx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/installation.mdx b/docs/installation.mdx index de9c224..4dfd8a1 100644 --- a/docs/installation.mdx +++ b/docs/installation.mdx @@ -243,3 +243,37 @@ PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig" \ CGO_CFLAGS_ALLOW="-Xpreprocessor" \ go build -o /usr/local/bin/imgproxy ``` + +## Systemd Service +Create file `/etc/systemd/system/imgproxy.service` with these contents: +``` +[Unit] +Description=imgproxy +After=network.target + +[Service] +Type=simple +ExecStart=/usr/local/bin/imgproxy + +Restart=on-failure +RestartSec=1s + +[Install] +WantedBy=multi-user.target +``` + +move `imgproxy` binary to `/usr/local/bin/imgproxy` + +enable & start service: +```bash +sudo systemctl enable imgproxy +sudo systemctl start imgproxy +``` + +check output: +```bash +journalctl -u imgproxy -n 50 -f +``` + + +