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

Switch from log files to journalctl

This commit is contained in:
yalh76 2019-02-08 18:24:05 +01:00
parent 4adf6733f1
commit cb0e112722
6 changed files with 13 additions and 24 deletions

View file

@ -6,8 +6,11 @@ After=network.target
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__/ StandardOutput=syslog
ExecStart=/bin/sh -c '__FINALPATH__/writefreely >> /var/log/__APP__/__APP__.log 2>&1' StandardError=syslog
WorkingDirectory=__FINALPATH__
ExecStart=__FINALPATH__/writefreely
Restart=always
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -73,7 +73,7 @@ ynh_mysql_dump_db "$db_name" > db.sql
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_backup "/etc/logrotate.d/$app" #ynh_backup "/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD

View file

@ -288,13 +288,6 @@ ynh_store_file_checksum "$final_path/config.ini"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#=================================================
# CREATE LOG FOLDER
#=================================================
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#================================================= #=================================================
# MAKE SETUP # MAKE SETUP
#================================================= #=================================================
@ -333,7 +326,7 @@ chown -R "$app":"$app" "$final_path"
### - And the section "SETUP LOGROTATE" in the upgrade script ### - And the section "SETUP LOGROTATE" in the upgrade script
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate #ynh_use_logrotate
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
@ -350,7 +343,7 @@ ynh_use_logrotate
#yunohost service add $app --log "/var/log/$app/APP.log" #yunohost service add $app --log "/var/log/$app/APP.log"
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added # if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log" yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT

View file

@ -91,7 +91,7 @@ ynh_remove_nginx_config
#================================================= #=================================================
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate #ynh_remove_logrotate
#================================================= #=================================================
# CLOSE A PORT # CLOSE A PORT
@ -116,7 +116,7 @@ fi
ynh_secure_remove "/etc/$app/" ynh_secure_remove "/etc/$app/"
# Remove the log files # Remove the log files
ynh_secure_remove "/var/log/$app/" #ynh_secure_remove "/var/log/$app/"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -114,7 +114,7 @@ systemctl daemon-reload
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log" yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
#================================================= #=================================================
# RESTORE THE CRON FILE # RESTORE THE CRON FILE
@ -126,7 +126,7 @@ yunohost service add $app --description "$app daemon for WriteFreely" --log "/va
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_restore_file "/etc/logrotate.d/$app" #ynh_restore_file "/etc/logrotate.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -137,13 +137,6 @@ ynh_restore_file "/etc/logrotate.d/$app"
#systemctl reload php5-fpm #systemctl reload php5-fpm
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
#================================================= #=================================================

View file

@ -166,7 +166,7 @@ fi
#================================================= #=================================================
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append #ynh_use_logrotate --non-append
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD