diff --git a/conf/systemd.service b/conf/systemd.service index 92eecf0..97d619c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,6 +3,7 @@ Description=Monitorix [Service] Type=simple +User=__SYSTEMD_USER__ ExecStart=/usr/bin/monitorix -c /etc/monitorix/monitorix.conf -p /var/run/monitorix.pid -n Restart=always diff --git a/scripts/_common.sh b/scripts/_common.sh index 9b78876..7c64a2a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,6 +3,7 @@ #================================================= app=$YNH_APP_INSTANCE_NAME +systemd_user=root #================================================= # DEFINE ALL COMMON FONCTIONS @@ -46,7 +47,7 @@ config_monitorix() { done monitorix_conf=/etc/monitorix/monitorix.conf - cp ../conf/monitorix.conf $monitorix_conf + cp ../conf/monitorix.conf $monitorix_conf ynh_replace_string --match_string __SERVICE_PORT__ --replace_string $port --target_file $monitorix_conf ynh_replace_string --match_string __YNH_DOMAIN__ --replace_string $domain --target_file $monitorix_conf ynh_replace_string --match_string __NGINX_STATUS_PORT__ --replace_string $nginx_status_port --target_file $monitorix_conf