diff --git a/conf/systemd.service b/conf/systemd.service new file mode 100644 index 00000000..9a582a32 --- /dev/null +++ b/conf/systemd.service @@ -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 \ No newline at end of file diff --git a/scripts/install b/scripts/install index 96879914..9eba9cca 100644 --- a/scripts/install +++ b/scripts/install @@ -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