Skip to content

Commit 4e571ab

Browse files
committed
Add systemd instructions to readme #271
1 parent 563d28e commit 4e571ab

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
2020
- Include JSON-AD in initial response, speed up first render #511
2121
- Remove feature to index external RDF files and search them #579
2222
- Replace `acme_lib` with `instant-acme`, drop OpenSSL dependency #192
23+
- Add staging environment #588
24+
- Add systemd instructions to readme #271
2325

2426
## [v0.34.0] - 2022-10-31
2527

server/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ https://user-images.githubusercontent.com/2183313/139728539-d69b899f-6f9b-44cb-a
4646
- [Running using a tunneling service (easy mode)](#running-using-a-tunneling-service-easy-mode)
4747
- [HTTPS Setup on a VPS (static IP required)](#https-setup-on-a-vps-static-ip-required)
4848
- [HTTPS Setup using external HTTPS proxy](#https-setup-using-external-https-proxy)
49+
- [Using `systemd` to run Atomic-Server as a service](#using-systemd-to-run-atomic-server-as-a-service)
4950
- [Usage](#usage)
5051
- [Using Atomic-Server with the browser GUI](#using-atomic-server-with-the-browser-gui)
5152
- [Use `atomic-cli` as client](#use-atomic-cli-as-client)
@@ -184,6 +185,48 @@ ATOMIC_HTTPS=false
184185
ATOMIC_SERVER_URL=https://example.com
185186
```
186187

188+
### Using `systemd` to run Atomic-Server as a service
189+
190+
In Unix operating systems, you can use `systemd` to manage a
191+
192+
Create a service:
193+
194+
```sh
195+
vim /etc/systemd/system/atomic.service
196+
```
197+
198+
Paste this:
199+
```
200+
[Unit]
201+
Description=Atomic-Server
202+
#After=network.targetdd
203+
StartLimitIntervalSec=0[Service]
204+
205+
[Service]
206+
Type=simple
207+
Restart=always
208+
RestartSec=1
209+
User=root
210+
ExecStart=/root/atomic-server
211+
WorkingDirectory=/root/
212+
EnvironmentFil=/root/.env
213+
214+
[Install]
215+
WantedBy=multi-user.target
216+
```
217+
218+
```sh
219+
# start service
220+
systemctl start atomic
221+
# check status
222+
systemctl status atomic
223+
# restart
224+
systemctl restart atomic
225+
# logs
226+
journalctl -u atomic.service
227+
# logs, since one hour, follow
228+
journalctl -u atomic.service --since "1 hour ago" -f
229+
```
187230
## Usage
188231

189232
There are three ways to interact with this server:

0 commit comments

Comments
 (0)