Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 6ea8b3b

Browse files
committed
Update the systemd service unit files
This updates the existing webUI and DB4S end point unit files, and also adds the missing unit files for the live daemon and api services.
1 parent 8e54744 commit 6ea8b3b

File tree

4 files changed

+65
-18
lines changed

4 files changed

+65
-18
lines changed

other/systemd/dbhub-api.service

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Unit]
2+
Description=DBHub.io API daemon
3+
Documentation=https://github.com/sqlitebrowser/dbhub.io
4+
Requires=network-online.target
5+
Wants=network-online.target
6+
AssertFileIsExecutable=/usr/local/bin/api
7+
8+
[Service]
9+
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
10+
ExecStart=/usr/local/bin/api
11+
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
12+
User=dbhub
13+
Group=dbhub
14+
PermissionsStartOnly=true
15+
NonBlocking=true
16+
SuccessExitStatus=0
17+
StandardOutput=journal
18+
StandardError=inherit
19+
Restart=always
20+
AmbientCapabilities=CAP_NET_BIND_SERVICE
21+
NoNewPrivileges=true
22+
23+
# Specifies the maximum file descriptor number that can be opened by this process
24+
LimitNOFILE=65536
25+
26+
[Install]
27+
WantedBy=multi-user.target

other/systemd/dbhub-db4s.service

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
[Unit]
22
Description=DBHub.io DB4S connector
33
Documentation=https://github.com/sqlitebrowser/dbhub.io
4-
Requires=postgresql-10.service
5-
Requires=memcached.service
4+
Requires=network-online.target
65
Wants=network-online.target
7-
After=postgresql-10.service
86
AssertFileIsExecutable=/usr/local/bin/db4s
97

108
[Service]
9+
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
1110
ExecStart=/usr/local/bin/db4s
12-
WorkingDirectory=/home/dbhub/go/src/github.com/sqlitebrowser/dbhub.io
11+
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
1312
User=dbhub
1413
Group=dbhub
1514
PermissionsStartOnly=true
1615
NonBlocking=true
1716
SuccessExitStatus=0
1817
StandardOutput=journal
1918
StandardError=inherit
20-
21-
# Let systemd restart this service only if it has ended with the clean exit code or signal.
22-
Restart=on-success
19+
Restart=always
20+
AmbientCapabilities=CAP_NET_BIND_SERVICE
21+
NoNewPrivileges=true
2322

2423
# Specifies the maximum file descriptor number that can be opened by this process
2524
LimitNOFILE=65536

other/systemd/dbhub-live.service

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Unit]
2+
Description=DBHub.io Live database daemon
3+
Documentation=https://github.com/sqlitebrowser/dbhub.io
4+
Requires=network-online.target
5+
Wants=network-online.target
6+
AssertFileIsExecutable=/usr/local/bin/live
7+
8+
[Service]
9+
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
10+
ExecStart=/usr/local/bin/live
11+
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
12+
User=dbhub
13+
Group=dbhub
14+
PermissionsStartOnly=true
15+
NonBlocking=true
16+
SuccessExitStatus=0
17+
StandardOutput=journal
18+
StandardError=inherit
19+
Restart=always
20+
AmbientCapabilities=CAP_NET_BIND_SERVICE
21+
NoNewPrivileges=true
22+
23+
# Specifies the maximum file descriptor number that can be opened by this process
24+
LimitNOFILE=65536
25+
26+
[Install]
27+
WantedBy=multi-user.target

other/systemd/dbhub-webui.service

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
[Unit]
22
Description=DBHub.io Website User Interface
33
Documentation=https://github.com/sqlitebrowser/dbhub.io
4-
Requires=postgresql-10.service
5-
Requires=memcached.service
6-
Requires=minio.service
4+
Requires=network-online.target
75
Wants=network-online.target
8-
After=postgresql-10.service
9-
After=memcached.service
10-
After=minio.service
116
AssertFileIsExecutable=/usr/local/bin/webui
127

138
[Service]
9+
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
1410
ExecStart=/usr/local/bin/webui
15-
WorkingDirectory=/home/dbhub/go/src/github.com/sqlitebrowser/dbhub.io
11+
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
1612
User=dbhub
1713
Group=dbhub
1814
PermissionsStartOnly=true
1915
NonBlocking=true
16+
SuccessExitStatus=0
2017
StandardOutput=journal
2118
StandardError=inherit
22-
SuccessExitStatus=0
19+
Restart=always
2320
AmbientCapabilities=CAP_NET_BIND_SERVICE
2421
NoNewPrivileges=true
2522

26-
# Let systemd restart this service only if it has ended with the clean exit code or signal.
27-
Restart=on-success
28-
2923
# Specifies the maximum file descriptor number that can be opened by this process
3024
LimitNOFILE=65536
3125

0 commit comments

Comments
 (0)