-
-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SEMPAPHORE_CONFIG=/etc/semaphore/config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |