forked from webmentordev/linux-bash-scripts-and-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup Systemd Service.txt
More file actions
46 lines (38 loc) · 1.16 KB
/
Setup Systemd Service.txt
File metadata and controls
46 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$ sudo nano /lib/systemd/system/pocketbase.service
# Your Systemd Paste following code
[Unit]
Description=Pocketbase Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/pocketbase/
ExecStart=/root/pocketbase/pocketbase --http=0.0.0.0:8090
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target
# 2. Start The Service and Link
$ sudo systemctl daemon-reload
$ sudo systemctl start pocketbase
$ sudo systemctl enable pocketbase
Pocketbase Offical Go Production Documentation
================================================================
[Unit]
Description = Pocketbase Service
After=network.target
[Service]
Type = simple
User = root
Group = root
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:/root/pocketbase/errors.log
StandardError = append:/root/pocketbase/errors.log
ExecStart = /root/pocketbase serve --http=0.0.0.0:8090
# ExecStart = /root/pocketbase serve https://mydomain.com
# ExecStart = /root/pocketbase serve https://api.mydomain.com
# ExecStart = /root/pocketbase serve yourdomain.com
[Install]
WantedBy = multi-user.target