Skip to content

Commit

Permalink
Update the systemd service unit files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
justinclift committed May 16, 2024
1 parent 8e54744 commit 6ea8b3b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 18 deletions.
27 changes: 27 additions & 0 deletions other/systemd/dbhub-api.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=DBHub.io API daemon
Documentation=https://github.com/sqlitebrowser/dbhub.io
Requires=network-online.target
Wants=network-online.target
AssertFileIsExecutable=/usr/local/bin/api

[Service]
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
ExecStart=/usr/local/bin/api
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
User=dbhub
Group=dbhub
PermissionsStartOnly=true
NonBlocking=true
SuccessExitStatus=0
StandardOutput=journal
StandardError=inherit
Restart=always
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

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

[Install]
WantedBy=multi-user.target
13 changes: 6 additions & 7 deletions other/systemd/dbhub-db4s.service
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[Unit]
Description=DBHub.io DB4S connector
Documentation=https://github.com/sqlitebrowser/dbhub.io
Requires=postgresql-10.service
Requires=memcached.service
Requires=network-online.target
Wants=network-online.target
After=postgresql-10.service
AssertFileIsExecutable=/usr/local/bin/db4s

[Service]
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
ExecStart=/usr/local/bin/db4s
WorkingDirectory=/home/dbhub/go/src/github.com/sqlitebrowser/dbhub.io
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
User=dbhub
Group=dbhub
PermissionsStartOnly=true
NonBlocking=true
SuccessExitStatus=0
StandardOutput=journal
StandardError=inherit

# Let systemd restart this service only if it has ended with the clean exit code or signal.
Restart=on-success
Restart=always
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
Expand Down
27 changes: 27 additions & 0 deletions other/systemd/dbhub-live.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=DBHub.io Live database daemon
Documentation=https://github.com/sqlitebrowser/dbhub.io
Requires=network-online.target
Wants=network-online.target
AssertFileIsExecutable=/usr/local/bin/live

[Service]
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
ExecStart=/usr/local/bin/live
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
User=dbhub
Group=dbhub
PermissionsStartOnly=true
NonBlocking=true
SuccessExitStatus=0
StandardOutput=journal
StandardError=inherit
Restart=always
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

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

[Install]
WantedBy=multi-user.target
16 changes: 5 additions & 11 deletions other/systemd/dbhub-webui.service
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
[Unit]
Description=DBHub.io Website User Interface
Documentation=https://github.com/sqlitebrowser/dbhub.io
Requires=postgresql-10.service
Requires=memcached.service
Requires=minio.service
Requires=network-online.target
Wants=network-online.target
After=postgresql-10.service
After=memcached.service
After=minio.service
AssertFileIsExecutable=/usr/local/bin/webui

[Service]
Environment="LD_LIBRARY_PATH=/home/dbhub/git_repos/dbhub.io/local/lib"
ExecStart=/usr/local/bin/webui
WorkingDirectory=/home/dbhub/go/src/github.com/sqlitebrowser/dbhub.io
WorkingDirectory=/home/dbhub/git_repos/dbhub.io
User=dbhub
Group=dbhub
PermissionsStartOnly=true
NonBlocking=true
SuccessExitStatus=0
StandardOutput=journal
StandardError=inherit
SuccessExitStatus=0
Restart=always
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

# Let systemd restart this service only if it has ended with the clean exit code or signal.
Restart=on-success

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

Expand Down

0 comments on commit 6ea8b3b

Please sign in to comment.