summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD15
-rw-r--r--newrelic-sysmond.service26
3 files changed, 25 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cde1e6da4a2..6178ac58ae0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -22,7 +22,7 @@ pkgbase = newrelic-sysmond
sha256sums = 052e42d156e20f77e78f82372123eadf069ef2e5758a1184725a906ead551d9b
sha256sums = 02d70a783e30a7b6f8c438b1bae5a57d37d2204d112ccca38eada2b9044a5ebe
sha256sums = bcce083629dcd0827f86247872ee4b42dec2c51349b4cc10c0ce7619f94faf9f
- sha256sums = 7ec93da5ddf521cd1850f1ef491182d7363fd565db8697c33261d09300fab6af
+ sha256sums = 58fade9de4793e22cda75816a74c52d5d9b831ab68bc7b8225aa1bb294b3b31b
pkgname = newrelic-sysmond
diff --git a/PKGBUILD b/PKGBUILD
index 5e1cd7d98a4..c0588b0aeb9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -37,7 +37,7 @@ source=("http://download.newrelic.com/server_monitor/archive/${pkgver}/${pkgname
sha256sums=('052e42d156e20f77e78f82372123eadf069ef2e5758a1184725a906ead551d9b'
'02d70a783e30a7b6f8c438b1bae5a57d37d2204d112ccca38eada2b9044a5ebe'
'bcce083629dcd0827f86247872ee4b42dec2c51349b4cc10c0ce7619f94faf9f'
- '7ec93da5ddf521cd1850f1ef491182d7363fd565db8697c33261d09300fab6af')
+ '58fade9de4793e22cda75816a74c52d5d9b831ab68bc7b8225aa1bb294b3b31b')
package() {
set -u
@@ -80,12 +80,13 @@ package() {
install -Dpm644 "${srcdir}/${pkgname}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgname}"
# Ensure there are no forbidden paths. Place at the end of package() and comment out as you find or need exceptions. (git-aurcheck)
- #! grep -lr "/sbin" "${pkgdir}" || echo "${}"
- ! grep -lr "/usr/tmp" "${pkgdir}" || echo "${}"
- #! grep -lr "/usr/local" "${pkgdir}" || echo "${}"
- #! pcregrep -lr "(?<!/usr)/bin" "${pkgdir}" || echo "${}"
- ! test -d "${pkgdir}/usr/sbin" || echo "${}"
- ! test -d "${pkgdir}/usr/local" || echo "${}"
+ ! test -d "${pkgdir}/sbin" || { echo "Forbidden: /sbin"; echo "${}"; }
+ ! test -d "${pkgdir}/usr/sbin" || { echo "Forbidden: /usr/sbin"; echo "${}"; }
+ ! test -d "${pkgdir}/usr/local" || { echo "Forbidden: /usr/local"; echo "${}"; }
+ #! grep -lr "/sbin" "${pkgdir}" || { echo "Forbidden: /sbin"; echo "${}"; }
+ ! grep -lr "/usr/tmp" "${pkgdir}" || { echo "Forbidden: /usr/tmp"; echo "${}"; }
+ #! grep -lr "/usr/local" "${pkgdir}" || { echo "Forbidden: /usr/local"; echo "${}"; }
+ ! pcregrep -lr "(?<!/usr)/bin" "${pkgdir}" || { echo "Forbidden: /bin"; echo "${}"; }
set +u
}
diff --git a/newrelic-sysmond.service b/newrelic-sysmond.service
index bb43dabc5e4..fe50d07a622 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