1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Fix services

This commit is contained in:
yalh76 2021-03-31 03:29:34 +02:00
parent 3fe6c4f269
commit 667deb5d4c
5 changed files with 24 additions and 24 deletions

View file

@ -8,7 +8,7 @@ User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/api
EnvironmentFile=__FINALPATH__/config/.env
ExecStart=__FINALPATH__/virtualenv/bin/celery -A funkwhale_api.taskapp worker --concurrency=${CELERYD_CONCURRENCY-0} --loglevel INFO --logfile=/var/log/__APP__/worker.log
ExecStart=__FINALPATH__/virtualenv/bin/celery -A funkwhale_api.taskapp worker --loglevel INFO --logfile=/var/log/__APP__/worker.log
#NoNewPrivileges=true
#PrivateDevices=true

View file

@ -167,7 +167,7 @@ pushd $final_path
python api/manage.py migrate
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name"
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$admin', '$admin_mail', 'funkwhale') " | python api/manage.py shell
python api/manage.py collectstatic
echo "yes" | python api/manage.py collectstatic
popd
#=================================================
@ -178,9 +178,9 @@ ynh_script_progression --message="Configuring a systemd service..."
ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target"
# Create a dedicated systemd config
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service"
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" --others_var="datadir"
#=================================================
# GENERIC FINALIZATION
@ -211,9 +211,9 @@ yunohost service add "${app}-worker" --log="/var/log/$app/worker.log"
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="/var/log/$app/beat.log"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="/var/log/$app/server.log"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="/var/log/$app/worker.log"
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
#=================================================
# SETUP FAIL2BAN

View file

@ -53,9 +53,9 @@ fi
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_systemd_action --action="stop" --service_name="${app}-beat"
ynh_systemd_action --action="stop" --service_name="${app}-server"
ynh_systemd_action --action="stop" --service_name="${app}-worker"
ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped Funkwhale"
# Remove the dedicated systemd config
ynh_remove_systemd_config --service="$app-server"

View file

@ -143,9 +143,9 @@ yunohost service add "${app}-worker" --log="/var/log/$app/worker.log"
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="/var/log/$app/beat.log"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="/var/log/$app/server.log"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="/var/log/$app/worker.log"
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
#=================================================
# GENERIC FINALIZATION

View file

@ -82,9 +82,9 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name="${app}-beat" --action="stop" --log_path="/var/log/$app/beat.log"
ynh_systemd_action --service_name="${app}-server" --action="stop" --log_path="/var/log/$app/server.log"
ynh_systemd_action --service_name="${app}-worker" --action="stop" --log_path="/var/log/$app/worker.log"
ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped Funkwhale"
ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped Funkwhale"
#=================================================
# MOVE DATAS
@ -184,7 +184,7 @@ pushd $final_path
python api/manage.py migrate
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name"
python api/manage.py collectstatic --clear --noinput
echo "yes" | python api/manage.py collectstatic --clear --noinput
# https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 # users-now-have-an-activitypub-actor-manual-action-required
# python api/manage.py script create_actors --no-input
@ -213,9 +213,9 @@ ynh_script_progression --message="Upgrading systemd configuration..."
ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target"
# Create a dedicated systemd config
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service"
ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" --others_var="datadir"
ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" --others_var="datadir"
#=================================================
# GENERIC FINALIZATION
@ -246,9 +246,9 @@ yunohost service add "${app}-worker" --log="/var/log/$app/worker.log"
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="/var/log/$app/beat.log"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="/var/log/$app/server.log"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="/var/log/$app/worker.log"
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete"
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled"
#=================================================
# UPGRADE FAIL2BAN