diff --git a/conf/systemd.service b/conf/systemd.service index 4071d0f..d339abb 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -14,6 +14,8 @@ StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit # Sandboxing options to harden security +# Depending on specificities of your service/app, you may need to tweak these +# .. but this should be a good baseline # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html NoNewPrivileges=yes PrivateTmp=yes diff --git a/scripts/install b/scripts/install index d922745..fa11a1b 100755 --- a/scripts/install +++ b/scripts/install @@ -116,6 +116,14 @@ pushd $final_path ynh_exec_as $app $final_path/venv/bin/pip install -r "$final_path/requirements.txt" popd +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." --weight=1 + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # ADD A CONFIGURATION #================================================= @@ -139,14 +147,6 @@ ynh_add_config --template="config.ini" --destination="$final_path/data/config/co chmod 660 "$final_path/data/config/config.ini" chown $app: "$final_path/data/config/config.ini" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #=================================================