feat(worker): don't run with a dedicated user
BREAKING: The worker service no longer uses a dedicated `celery` user to run. The old `celery` user can be removed from the system.
This commit is contained in:
parent
6d5c58fbcb
commit
8278366899
|
@ -55,6 +55,15 @@ The legacy logrotate config filepath was changed from `/etc/logrotate.d/airtime-
|
||||||
sudo rm -f /etc/logrotate.d/airtime-php
|
sudo rm -f /etc/logrotate.d/airtime-php
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Worker user
|
||||||
|
|
||||||
|
The worker service no longer uses a dedicated `celery` user to run. The old `celery` user can be removed from the system:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Remove the celery user
|
||||||
|
sudo deluser celery
|
||||||
|
```
|
||||||
|
|
||||||
### New configuration schema
|
### New configuration schema
|
||||||
|
|
||||||
The configuration schema was updated.
|
The configuration schema was updated.
|
||||||
|
|
15
install
15
install
|
@ -1020,21 +1020,10 @@ systemInitInstall libretime-liquidsoap "$web_user"
|
||||||
systemInitInstall libretime-playout "$web_user"
|
systemInitInstall libretime-playout "$web_user"
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing celery..."
|
verbose "\n * Installing worker..."
|
||||||
loudCmd "$pip_install ${AIRTIMEROOT}/worker"
|
loudCmd "$pip_install ${AIRTIMEROOT}/worker"
|
||||||
mkdir_and_chown "${web_user}:${web_user}" "${LIBRETIME_WORKING_DIR}/worker"
|
mkdir_and_chown "${web_user}:${web_user}" "${LIBRETIME_WORKING_DIR}/worker"
|
||||||
# Create the Celery user
|
systemInitInstall libretime-celery "$web_user"
|
||||||
if $is_centos_dist; then
|
|
||||||
loudCmd "id celery 2>/dev/null || adduser --no-create-home -c 'LibreTime Celery' -r celery || true"
|
|
||||||
else
|
|
||||||
loudCmd "id celery 2>/dev/null || adduser --no-create-home --gecos 'LibreTime Celery' --disabled-login --firstuid 1 --lastuid 999 celery"
|
|
||||||
fi
|
|
||||||
# Add celery to the www-data group
|
|
||||||
loudCmd "usermod -G ${web_user} -a celery"
|
|
||||||
# CentOS installs celery in /usr/bin which differs from other distros. Make
|
|
||||||
# available in /usr/local/bin as systemd requires an absolute path.
|
|
||||||
[[ ! -e /usr/local/bin/celery ]] && ln -s /usr/bin/celery /usr/local/bin/celery
|
|
||||||
systemInitInstall libretime-celery celery
|
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing libretime-analyzer..."
|
verbose "\n * Installing libretime-analyzer..."
|
||||||
|
|
|
@ -165,10 +165,7 @@ function checkLiquidsoapService()
|
||||||
*/
|
*/
|
||||||
function checkCeleryService()
|
function checkCeleryService()
|
||||||
{
|
{
|
||||||
exec('pgrep -f -u celery libretime_worker', $out, $status);
|
exec('systemctl is-active libretime-celery --quiet', $out, $status);
|
||||||
if (array_key_exists(0, $out) && $status == 0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $status == 0;
|
return $status == 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue