From 6eb5091c41c3c99517956f5cba42c53a3eb04162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 22 Jan 2023 15:32:36 +0100 Subject: [PATCH] specify user in systemd config --- conf/systemd.service | 1 + scripts/_common.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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