1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Fix logrotate and YunoHost service definition

This commit is contained in:
Jimmy Monin 2018-05-23 21:22:00 +02:00
parent 20f21c4bbc
commit a27e6948d0
4 changed files with 14 additions and 10 deletions

View file

@ -44,6 +44,12 @@ ynh_backup "$final_path"
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup "/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================

View file

@ -289,6 +289,8 @@ mkdir "$final_path/tmp/sockets"
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
# Restrict rights to log directory (needed by logrotate)
chmod g-w $final_path/log
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
@ -296,12 +298,14 @@ chown -R $app: $final_path
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate "$final_path/log/unicorn.stderr.log" ynh_use_logrotate "$final_path/log/unicorn.stderr.log"
ynh_use_logrotate "$final_path/log/unicorn.stdout.log"
ynh_use_logrotate "$final_path/log/production.log"
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
yunohost service add $app --log "$final_path/log/unicorn.stderr.log" yunohost service add $app --log "$final_path/log/unicorn.stderr.log" "$final_path/log/unicorn.stdout.log" "$final_path/log/production.log"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT

View file

@ -92,12 +92,6 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
systemctl daemon-reload systemctl daemon-reload
systemctl enable $app.service systemctl enable $app.service
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_use_logrotate
#================================================= #=================================================
# RECREATE OF THE DEDICATED USER # RECREATE OF THE DEDICATED USER
#================================================= #=================================================
@ -110,13 +104,12 @@ ynh_system_user_create $app $final_path 1
#================================================= #=================================================
chown -R $app: $final_path chown -R $app: $final_path
chown -R $app: /var/log/$app
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
yunohost service add $app --log "$final_path/log/unicorn.stderr.log" yunohost service add $app --log "$final_path/log/unicorn.stderr.log" "$final_path/log/unicorn.stdout.log" "$final_path/log/production.log"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -187,7 +187,8 @@ if ! ynh_is_upstream_up_to_date ; then
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
# Restrict rights to log directory (needed by logrotate)
chmod g-w $final_path/log
fi fi
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT