1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Add systemd

This commit is contained in:
ericgaspar 2021-12-10 17:39:47 +01:00
parent f310e55bec
commit db10be49ce
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 18 additions and 4 deletions

14
conf/systemd.service Normal file
View file

@ -0,0 +1,14 @@
[Unit]
Description=Pixelfed task queueing via Laravel Horizon
After=network.target
[Service]
Type=simple
User=__APP__
Group=__APP__
ExecStart=php__PHPVERSION__ __FINALPATH__/artisan horizon
Restart=on-failure
stdout_logfile=/var/log/__APP__/__APP__-horizon.log
[Install]
WantedBy=multi-user.target

View file

@ -154,10 +154,10 @@ chown $app:$app "$final_path/.env"
#=================================================
# SETUP SUPERVISOR
#=================================================
ynh_script_progression --message="Configuring a supervisor service..."
ynh_script_progression --message="Configuring a systemd service..."
# Create a dedicated supervisor config
ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf
ynh_add_systemd_config
#=================================================
# DEPLOY
@ -204,7 +204,7 @@ ynh_use_logrotate --logfile="/var/log/$app/${app}-horizon.log"
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add "supervisor" --description="Supervisor daemon for $app" --log="/var/log/$app/${app}-horizon.log"
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/${app}-horizon.log"
#=================================================
# START SUPERVISOR SERVICE
@ -212,7 +212,7 @@ yunohost service add "supervisor" --description="Supervisor daemon for $app" --l
ynh_script_progression --message="Starting a supervisor service..."
# Start a supervisor service
ynh_supervisor_action --service_name="${app}-horizon" --action="reload" --log_path="systemd" --line_match="success: ${app}-horizon"
ynh_supervisor_action --service_name="$app" --action="reload" --log_path="systemd" --line_match="success: ${app}-horizon"
#=================================================
# SETUP SSOWAT