mirror of
https://github.com/YunoHost-Apps/funkwhale_ynh.git
synced 2024-09-03 18:36:24 +02:00
handle log dir creation out of SystemD
This commit is contained in:
parent
8f6d0020b2
commit
992def3f22
7 changed files with 24 additions and 22 deletions
|
@ -9,9 +9,6 @@ Group=__APP__
|
|||
WorkingDirectory=__FINALPATH__/code/api
|
||||
EnvironmentFile=__FINALPATH__/code/config/.env
|
||||
|
||||
PermissionsStartOnly=true
|
||||
ExecStartPre=/bin/mkdir -p /var/log/__APP__
|
||||
ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__
|
||||
ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp beat \
|
||||
--loglevel INFO --logfile=/var/log/__APP__/beat.log
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ Group=__APP__
|
|||
WorkingDirectory=__FINALPATH__/code/api
|
||||
EnvironmentFile=__FINALPATH__/code/config/.env
|
||||
|
||||
PermissionsStartOnly=true
|
||||
ExecStartPre=/bin/mkdir -p /var/log/__APP__
|
||||
ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__
|
||||
ExecStart=__FINALPATH__/code/virtualenv/bin/daphne -b ${FUNKWHALE_API_IP} -p ${FUNKWHALE_API_PORT} config.asgi:application --proxy-headers \
|
||||
--verbosity 1 --access-log=/var/log/__APP__/server.log
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ Group=__APP__
|
|||
WorkingDirectory=__FINALPATH__/code/api
|
||||
EnvironmentFile=__FINALPATH__/code/config/.env
|
||||
|
||||
PermissionsStartOnly=true
|
||||
ExecStartPre=/bin/mkdir -p /var/log/__APP__
|
||||
ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__
|
||||
ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO \
|
||||
--loglevel INFO --logfile=/var/log/__APP__/worker.log
|
||||
|
||||
|
|
|
@ -226,6 +226,9 @@ systemctl restart "$app".target
|
|||
chown -R "$app": "$final_path"
|
||||
chmod -R 755 "$final_path/code/front/dist/"
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app": "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# SETUP FAIL2BAN
|
||||
#=================================================
|
||||
|
|
|
@ -24,19 +24,6 @@ redis_db=$(ynh_app_setting_get $app redis_db)
|
|||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
|
||||
systemctl stop "$app".target
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config "$app-server"
|
||||
ynh_remove_systemd_config "$app-worker"
|
||||
ynh_remove_systemd_config "$app-beat"
|
||||
|
||||
ynh_secure_remove "/etc/systemd/system/$app.target"
|
||||
|
||||
#=================================================
|
||||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
#=================================================
|
||||
|
@ -60,6 +47,19 @@ then
|
|||
yunohost service remove "$app-beat"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
|
||||
systemctl stop "$app".target
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config "$app-server"
|
||||
ynh_remove_systemd_config "$app-worker"
|
||||
ynh_remove_systemd_config "$app-beat"
|
||||
|
||||
ynh_secure_remove "/etc/systemd/system/$app.target"
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE PostgreSQL DATABASE
|
||||
#=================================================
|
||||
|
@ -88,6 +88,8 @@ ynh_remove_app_dependencies
|
|||
# Remove the app directory securely
|
||||
ynh_secure_remove "$final_path"
|
||||
|
||||
ynh_secure_remove "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -115,6 +115,9 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
|
|||
# Restore permissions on app files
|
||||
chown -R "$app": "$final_path"
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app": "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
|
|
@ -236,6 +236,9 @@ systemctl restart "$app".target
|
|||
chown -R "$app": "$final_path"
|
||||
chmod -R 755 "$final_path/code/front/dist/"
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app": "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# SETUP FAIL2BAN
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue