1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Fix Service logs

This commit is contained in:
yalh76 2019-02-02 00:33:52 +01:00
parent 37f38a352b
commit ca46b19f56
3 changed files with 13 additions and 5 deletions

View file

@ -5,9 +5,10 @@ After=network.target postgresql.service
[Service] [Service]
Environment="MIX_ENV=prod" Environment="MIX_ENV=prod"
User=__APP__ User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/__APP__ WorkingDirectory=__FINALPATH__/__APP__
Environment="HOME=__FINALPATH__" Environment="HOME=__FINALPATH__"
ExecStart=/usr/bin/mix phx.server ExecStart=/bin/sh -c '/usr/bin/mix phx.server >> /var/log/__APP__/__APP__.log 2>&1'
ExecReload=/bin/kill $MAINPID ExecReload=/bin/kill $MAINPID
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure

View file

@ -215,9 +215,12 @@ ynh_system_user_create "$app" "$final_path"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# ... # CREATE LOG FOLDER
#================================================= #=================================================
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
@ -248,9 +251,8 @@ else
ynh_replace_string "__REG__" "false" "$final_path/$app/config/prod.secret.exs" ynh_replace_string "__REG__" "false" "$final_path/$app/config/prod.secret.exs"
fi fi
#================================================= #=================================================
# SETUP # MAKE SETUP
#================================================= #=================================================
# Give permission to the final_path # Give permission to the final_path
chown -R "$app":"$app" "$final_path" chown -R "$app":"$app" "$final_path"

View file

@ -104,7 +104,6 @@ chown -R "$app":"$app" "$final_path"
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
# Add erlang for Debian Jessie # Add erlang for Debian Jessie
if [ "$(lsb_release --codename --short)" == "jessie" ]; then if [ "$(lsb_release --codename --short)" == "jessie" ]; then
@ -154,6 +153,12 @@ ynh_restore_file "/etc/logrotate.d/$app"
systemctl reload nginx systemctl reload nginx
#=================================================
# CREATE LOG FOLDER
#=================================================
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#================================================= #=================================================
# START SERVICE # START SERVICE