v3.0.0/docs/systemd.md

31 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

2021-01-05 03:40:52 +01:00
### Service config for systemd
2021-06-07 10:40:28 +02:00
If you want to keep Chibisafe running by using systemd you can copy the example code shown below and create the file `/etc/systemd/system/chibisafe.service` with it.
2021-01-05 03:40:52 +01:00
You will need to edit the parameters:
- `User` to be the username/uid of your chibisafe instance
- `WorkingDirectory` to the **FULL** path to your chibisafe, `/home/chibisafe/chibisafe` for example.
- `EnvironmentFile` the same as the above, with the addition of `/.env`, `/home/chibisafe/chibisafe/.env`
2021-01-05 05:56:47 +01:00
### If you are using n/nvm you will also need to update the path to npm in `ExecStart`
- For n this will likely be `/home/username/n/bin/npm`
- You can also find this by running `whereis npm` in your terminal and copy the path from the output.
2021-01-05 03:41:39 +01:00
Example below.
2021-06-07 10:40:28 +02:00
```
[Unit]
2021-01-05 03:40:52 +01:00
Description=chibisafe, easy to use file uploader
After=network.target
[Service]
Type=simple
User=chibisafe
WorkingDirectory=/home/chibisafe/chibisafe
EnvironmentFile=/home/chibisafe/chibisafe/.env
ExecStart=/usr/bin/npm run start
Restart=always
[Install]
2021-06-07 10:40:28 +02:00
WantedBy=multi-user.target
```