diff options
author | Alex Auvolat <alex@adnab.me> | 2021-05-31 17:13:36 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-05-31 17:13:36 +0200 |
commit | d76a8576f440a90d87fbeaabc80131eadafc88b7 (patch) | |
tree | 161128350c0b1af8415df195ffb001bf2a372e23 /doc/book/src/cookbook/systemd.md | |
parent | 289521886bc5819790c92da6cdf24898aacbaf58 (diff) | |
download | garage-d76a8576f440a90d87fbeaabc80131eadafc88b7.tar.gz garage-d76a8576f440a90d87fbeaabc80131eadafc88b7.zip |
Reorganize documentation
Diffstat (limited to 'doc/book/src/cookbook/systemd.md')
-rw-r--r-- | doc/book/src/cookbook/systemd.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/book/src/cookbook/systemd.md b/doc/book/src/cookbook/systemd.md new file mode 100644 index 00000000..aded09ad --- /dev/null +++ b/doc/book/src/cookbook/systemd.md @@ -0,0 +1,39 @@ +# Starting Garage with systemd instead of Docker + +NOTE: This guide is incomplete. Typicall you would also want to create a separate +Unix user to run Garage. + +Make sure you have the Garage binary installed on your system (see [quick start](../quick_start/index.md)), e.g. at `/usr/local/bin/garage`. + +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/garage.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. |