From 44d0815ff98b72cd4f23b41ab6c87a867a392815 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 17 Mar 2021 20:04:27 +0100 Subject: Wrote daemon --- doc/book/src/getting_started/daemon.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'doc/book/src/getting_started') diff --git a/doc/book/src/getting_started/daemon.md b/doc/book/src/getting_started/daemon.md index 0f0199fe..7c303c6a 100644 --- a/doc/book/src/getting_started/daemon.md +++ b/doc/book/src/getting_started/daemon.md @@ -186,3 +186,36 @@ Please note that we use host networking as otherwise Docker containers can no co To upgrade, simply stop and remove this container and start again the command with a new version of garage. ### For systemd/raw binary users + +Create a file named `/etc/systemd/system/garage.service`: + +```toml +[Unit] +Description=Garage Data Store +After=network-online.target +Wants=network-online.target + +[Service] +Environment='RUST_LOG=garage=info' 'RUST_BACKTRACE=1' +ExecStart=/usr/local/bin/garage server -c /etc/garage/config.toml + +[Install] +WantedBy=multi-user.target +``` + +To start the service then automatically enable it at boot: + +```bash +sudo systemctl start garage +sudo systemctl enable garage +``` + +To see if the service is running and to browse its logs: + +```bash +sudo systemctl status garage +sudo journalctl -u garage +``` + +If you want to modify the service file, do not forget to run `systemctl daemon-reload` +to inform `systemd` of your modifications. -- cgit v1.2.3