summarylogtreecommitdiffstats
path: root/newrelic-sysmond.service
diff options
context:
space:
mode:
Diffstat (limited to 'newrelic-sysmond.service')
-rw-r--r--newrelic-sysmond.service26
1 files changed, 16 insertions, 10 deletions
diff --git a/newrelic-sysmond.service b/newrelic-sysmond.service
index bb43dabc5e41..fe50d07a6229 100644
--- a/newrelic-sysmond.service
+++ b/newrelic-sysmond.service
@@ -4,27 +4,33 @@ After=network.target
[Service]
Type=forking
-PIDFile=/run/nrsysmond.pid
+PIDFile=/run/nrsysmond/nrsysmond.pid
# https://blog.hqcodeshop.fi/archives/93-Handling-varrun-with-systemd.html
# Run ExecStartPre with root-permissions
# This seems easier and more reliable than tmpfiles.d
PermissionsStartOnly=true
-ExecStartPre=/usr/bin/touch /run/nrsysmond.pid
-ExecStartPre=/usr/bin/chown NEWRELIC_USER:NEWRELIC_USER /run/nrsysmond.pid
+ExecStartPre=/usr/bin/mkdir -p /run/nrsysmond
+ExecStartPre=/usr/bin/chown -R NEWRELIC_USER:NEWRELIC_USER /run/nrsysmond/
User=NEWRELIC_USER
Group=NEWRELIC_USER
# Run ExecStart with User
-ExecStart=/usr/bin/nrsysmond -c '/etc/newrelic/nrsysmond.cfg' -p '/run/nrsysmond.pid'
+ExecStart=/usr/bin/nrsysmond -c '/etc/newrelic/nrsysmond.cfg' -p '/run/nrsysmond/nrsysmond.pid'
# Arch Linux:
-# The user and group must be the same. Change all 4 at once. Don't pick a system defined user.
-# If you change the user and group names after installation, you should:
-# 1) userdel 'olduser' # if it's not being used for something else
-# 2) groupdel 'olduser' # if it's not being used for something else
-# 3) rm -rf '/.olduser' # if there's nothing in here of importance
-# 4) newrelic-sysmond.inst install # to create new user, group, and to chown folders
+# The user and group must be the same. Change all 4 at once. Don't pick a system defined user like uucp or http.
+# To change the username (and group)
+# systemctl stop newrelic-sysmond.service
+# # Change the 4 names and groups in the service file to the new username
+# systemctl daemon-reload
+# userdel 'olduser' # if it's not being used for something else
+# groupdel 'olduser' # if it's not being used for something else
+# rm -rf '/.olduser' # if there's nothing in here of importance
+# newrelic-sysmond-inst install # to create new user, group, and to chown folders
+# systemctl start newrelic-sysmond.service
+# systemctl status newrelic-sysmond.service
+# ps -ef | grep sysmond
# If you uninstall another New Relic package and find that the user and group have disappeared
# simply run: newrelic-sysmond.inst install