mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
systemd example
This commit is contained in:
parent
1a9ae22382
commit
cca5d8fbcf
12
deployment/systemd/README.md
Normal file
12
deployment/systemd/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Systemd
|
||||||
|
|
||||||
|
This is a sample systemd unit and environment file that you could use to run Semaphore with.
|
||||||
|
It makes no assumptions about running proxies or databases on the same machine,
|
||||||
|
therefore if you do this you may wish to add addition requirements to the unit.
|
||||||
|
The unit will write logs to the journal which you can read with
|
||||||
|
`journalctl -u semaphore.service`
|
||||||
|
|
||||||
|
Example install, and for convenience uninstall, scripts are located in the util subdir.
|
||||||
|
The scripts expect that you manually install semaphore in /usr/bin and have the config file
|
||||||
|
/etc/semaphore/config.json. The config file location can be altered via the env file,
|
||||||
|
which the script installs as /etc/semaphore/env
|
1
deployment/systemd/env
Normal file
1
deployment/systemd/env
Normal file
@ -0,0 +1 @@
|
|||||||
|
SEMPAPHORE_CONFIG=/etc/semaphore/config.json
|
14
deployment/systemd/semaphore.service
Normal file
14
deployment/systemd/semaphore.service
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Ansible Semaphore
|
||||||
|
Requires=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=/etc/semaphore/env
|
||||||
|
ExecStart=/usr/bin/semaphore -config ${SEMAPHORE_CONFIG}
|
||||||
|
User=semaphore
|
||||||
|
Group=semaphore
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
9
deployment/systemd/util/install.sh
Executable file
9
deployment/systemd/util/install.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
mkdir -p /etc/semaphore
|
||||||
|
cp ${HERE}/../semaphore.service /etc/systemd/system
|
||||||
|
cp ${HERE}/../env /etc/semaphore/env
|
||||||
|
systemctl start semaphore.service
|
7
deployment/systemd/util/uninstall.sh
Executable file
7
deployment/systemd/util/uninstall.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
systemctl stop semaphore.service
|
||||||
|
systemctl disable semaphore.service
|
||||||
|
rm /etc/systemd/system/semaphore.service
|
||||||
|
rm -rf /etc/semaphore
|
Loading…
Reference in New Issue
Block a user