1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jitsi_ynh.git synced 2024-09-03 19:35:57 +02:00

switch logs to systemd

This commit is contained in:
yalh76 2020-03-31 17:42:55 +02:00
parent 13775f6dc2
commit 025bbedd4a
5 changed files with 24 additions and 36 deletions

View file

@ -38,9 +38,9 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
#================================================= #=================================================
ynh_print_info --message="Stopping a systemd service..." ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="systemd" --line_match="Stopped $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="systemd" --line_match="Stopped $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="stop" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="stop" --log_path="systemd" --line_match="Stopped coturn"
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
@ -111,9 +111,9 @@ ynh_backup --src_path="/etc/systemd/system/$app-coturn.service"
#================================================= #=================================================
ynh_print_info --message="Starting a systemd service..." ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="systemd" --line_match="Started $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="systemd" --line_match="Started $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="systemd" --line_match="Started coturn"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -185,8 +185,6 @@ fi
ynh_store_file_checksum --file="$coturn_config" ynh_store_file_checksum --file="$coturn_config"
mkdir -p /var/log/$app
#================================================= #=================================================
# CONFIGURE METRONOME # CONFIGURE METRONOME
#================================================= #=================================================
@ -318,7 +316,6 @@ ynh_print_info --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
chown -R $app: /var/log/$app
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
@ -333,9 +330,9 @@ ynh_use_logrotate
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..." ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add $app-videobridge --description "$app jitsi-videobridge for jitsi" --log "/var/log/$app/$app-videobridge.log" yunohost service add $app-videobridge --description "$app jitsi-videobridge for jitsi" --log_type "systemd"
yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --log "/var/log/$app/$app-jicofo.log" yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --log_type "systemd"
yunohost service add $app-coturn --description "$app jitsi-coturn for jitsi" --log "/var/log/$app/$app-coturn.log" yunohost service add $app-coturn --description "$app jitsi-coturn for jitsi" --log_type "systemd"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -343,9 +340,9 @@ yunohost service add $app-coturn --description "$app jitsi-coturn for jitsi" --l
ynh_print_info --message="Starting a systemd service..." ynh_print_info --message="Starting a systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="systemd" --line_match="Started $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="systemd" --line_match="Started $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="systemd" --line_match="Started coturn"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT

View file

@ -166,13 +166,6 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
yunohost domain remove coturn.$domain yunohost domain remove coturn.$domain
fi fi
#=================================================
# REMOVE THE LOG FILES
#=================================================
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -164,18 +164,18 @@ systemctl enable $app-coturn.service
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..." ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" yunohost service add $app-videobridge --log_type "systemd"
yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" yunohost service add $app-jicofo --log_type "systemd"
yunohost service add $app-coturn --log "/var/log/$app/$app-coturn.log" yunohost service add $app-coturn --log_type "systemd"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_print_info --message="Starting a systemd service..." ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="systemd" --line_match="Started $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="systemd" --line_match="Started $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="systemd" --line_match="Started coturn"
#================================================= #=================================================

View file

@ -96,9 +96,9 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_print_info --message="Stopping a systemd service..." ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="systemd" --line_match="Stopped $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="systemd" --line_match="Stopped $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="stop" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="stop" --log_path="systemd" --line_match="Stopped coturn"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -180,8 +180,6 @@ fi
ynh_store_file_checksum --file="$coturn_config" ynh_store_file_checksum --file="$coturn_config"
mkdir -p /var/log/$app
#================================================= #=================================================
# BUILD JITSI-VIDEOBRIDGE # BUILD JITSI-VIDEOBRIDGE
#================================================= #=================================================
@ -292,9 +290,9 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
#================================================= #=================================================
ynh_print_info --message="Starting a systemd service..." ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="systemd" --line_match="Started $app-videobridge"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="systemd" --line_match="Started $app-jicofo"
ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="/var/log/$app/$app-coturn.log" ynh_systemd_action --service_name=$app-coturn --action="start" --log_path="systemd" --line_match="Started coturn"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX