-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service Configuration and Management
This patch overhauls the Systemd services. It adds a master service to allow for easier management of pyCA, starting and stopping it using one easy command. It also changes the main configuration location to allow for multiple configuration files. The master service controls all other services, allowing to use the following commands to shut them down as well: systemctl start pyca.service systemctl stop pyca.service systemctl restart pyca.service Not that for this to work, the other services must be anabled. This also means that you can still exclude services like the user interface by disabling them. Usually, though, you want to run this to ensure pyCA is fully functional as service: systemctl enable pyca-agentstate.service systemctl enable pyca-capture.service systemctl enable pyca-ingest.service systemctl enable pyca-schedule.service systemctl enable pyca-ui.service The main configuration file is now located at `/etc/pyca/pyca.conf` The additional sirectory ensures that additional configuration files can be stored. One new default configuration is `/etc/pyca/gunicorn.conf.py` which is included in the Systemd unit file for the user interface and for which a default one is included in the `etc` folder.
- Loading branch information
Showing
11 changed files
with
46 additions
and
22 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
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,19 @@ | ||
import multiprocessing | ||
|
||
# Gunicorn configuration for pyCA user interface | ||
# | ||
# For details of the available optiuons see: | ||
# https://docs.gunicorn.org/en/stable/settings.html#settings | ||
|
||
# The socket to bind. | ||
# This can be a TCP socket: | ||
# bind = "127.0.0.1:8000" | ||
# …or a UNIX socket: | ||
# bind = "unix:/var/run/pyca/uisocket" | ||
# | ||
# Default: "127.0.0.1:8000" | ||
#bind = "127.0.0.1:8000" | ||
|
||
# The number of worker processes for handling requests. | ||
# Default: 1 | ||
workers = multiprocessing.cpu_count() |
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
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
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
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
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
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
[Unit] | ||
Description=Python Capture Agent | ||
Documentation=https://github.com/opencast/pyCA | ||
Wants=network.target | ||
PartOf=pyca.target | ||
Description=PyCA | ||
|
||
[Service] | ||
Type=simple | ||
User=pyca | ||
ExecStart=/usr/bin/pyca | ||
Restart=always | ||
RestartSec=10 | ||
TimeoutSec=300 | ||
Type=oneshot | ||
ExecStart=/bin/true | ||
# Considered unit active after start | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=pyca.target | ||
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
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
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