diff options
author | Paul Severance | 2015-08-01 04:36:28 +0000 |
---|---|---|
committer | Paul Severance | 2015-08-01 04:36:28 +0000 |
commit | d77c11c1464c83e3205508188863e364cb8c55cf (patch) | |
tree | bdd210f230dbc5cc7780e62a453673cb9939d40e | |
download | aur-d77c11c1464c83e3205508188863e364cb8c55cf.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | newrelic-sysmond.install | 96 | ||||
-rw-r--r-- | newrelic-sysmond.service | 11 |
4 files changed, 175 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b19aaf828d79 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = newrelic-sysmond + pkgdesc = system monitor services provided by newrelic + pkgver = 2.1.0.124 + pkgrel = 1 + url = http://newrelic.com/ + install = newrelic-sysmond.install + arch = i686 + arch = x86_64 + license = non-free + makedepends = binutils + depends = glibc + depends = bash + backup = etc/newrelic/nrsysmond.cfg + source = http://download.newrelic.com/server_monitor/archive/2.1.0.124/newrelic-sysmond-2.1.0.124-linux.tar.gz + source = newrelic-sysmond.service + source = newrelic-sysmond.install + md5sums = b18f27bec4c9e5a5cf524225e41a7d15 + md5sums = f4ebc44c550896309d6121455a8669f3 + md5sums = aa0022b03b291c97f5f4b3cb2d24104d + +pkgname = newrelic-sysmond + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..195532ed7b53 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Felix Yan <felixonmars@archlinux.org> +# Contributor: Preston <pentie [at] gmail.com> + +pkgname=newrelic-sysmond +pkgver=2.1.0.124 +pkgrel=1 +pkgdesc="system monitor services provided by newrelic" +arch=('i686' 'x86_64') +url="http://newrelic.com/" +license=('non-free') +depends=('glibc' 'bash') +makedepends=('binutils') +backup=('etc/newrelic/nrsysmond.cfg') +install=newrelic-sysmond.install +source=("http://download.newrelic.com/server_monitor/archive/${pkgver}/${pkgname}"-"${pkgver}"-"linux.tar.gz" + "newrelic-sysmond.service" + "newrelic-sysmond.install") + +build() { + cd "$srcdir/$pkgname-$pkgver-linux" +} + +package() { + cd "$srcdir/$pkgname-$pkgver-linux" + mkdir -p "$pkgdir"/usr/bin/ \ + "$pkgdir"/etc/newrelic/ \ + "$pkgdir"/etc/default/ \ + "$pkgdir"/usr/share/doc/newrelic/ \ + "$pkgdir"/usr/lib/systemd/system/; + + if [ $CARCH == i686 ]; then + install -v -Dm755 ./daemon/nrsysmond.x86 "$pkgdir"/usr/bin/nrsysmond + else + install -v -Dm755 ./daemon/nrsysmond.x64 "$pkgdir"/usr/bin/nrsysmond + fi + + install -v -Dm644 ./nrsysmond.cfg "$pkgdir"/etc/newrelic/ + install -v -Dm755 ./scripts/nrsysmond-config "$pkgdir"/usr/bin/ + install -v -Dm644 ./scripts/newrelic-sysmond.default.debian "$pkgdir"/etc/default/newrelic-sysmond + install -v -Dm644 INSTALL.txt LICENSE.txt "$pkgdir"/usr/share/doc/newrelic/ + install -v -Dm644 ../newrelic-sysmond.service "$pkgdir"/usr/lib/systemd/system/ +} + +md5sums=('b18f27bec4c9e5a5cf524225e41a7d15' + 'f4ebc44c550896309d6121455a8669f3' + 'aa0022b03b291c97f5f4b3cb2d24104d') diff --git a/newrelic-sysmond.install b/newrelic-sysmond.install new file mode 100644 index 000000000000..7dcd539d4cdb --- /dev/null +++ b/newrelic-sysmond.install @@ -0,0 +1,96 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +post_install() { + +#!/bin/sh +# Create the newrelic user and group +useradd --system -M --home / --shell /sbin/nologin newrelic || true + +# Kludge the permissions +mkdir /var/log/newrelic +chmod 1777 /var/log/newrelic + +cfgfile=/etc/newrelic/nrsysmond.cfg + +chown root:newrelic ${cfgfile} +chmod 640 ${cfgfile} + +# +# When first installing the package, the license key will not be set. +# Instead of throwing an error, we want to whine to the user and then exit cleanly. +# + +if sed -e '/^[ ]*#/d' "${cfgfile}" 2> /dev/null | grep -q 'REPLACE_WITH_REAL_KEY' 2> /dev/null; then + if [ -z "${NR_SILENT}" -a -z "${SILENT}" ]; then + # + # WARNING - This text is duplicated from newrelic-sysmond.init + # + cat <<EOF + +********************************************************************* +********************************************************************* +*** +*** Can not start the New Relic Server Monitor until you insert a +*** valid license key in the following file: +*** +*** ${cfgfile} +*** +*** You can do this by running the following command as root: +*** +*** nrsysmond-config --set license_key=<your_license_key_here> +*** +*** No data will be reported until the server monitor can start. +*** You can get your New Relic key from the 'Configuration' section +*** of the 'Support' menu of your New Relic account (accessible at +*** https://rpm.newrelic.com). +*** +********************************************************************* +********************************************************************* + +For systemd users: + + systemctl start newrelic-sysmond.service + +EOF + fi + return 0 +fi + + +} + +## arg 1: the new package version +## arg 2: the old package version +pre_upgrade() { + # do something here + return 0 +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + # do something here + return 0 +} + +## arg 1: the old package version +pre_remove() { + # do something here + return 0 +} + +## arg 1: the old package version +post_remove() { + # do something here + userdel newrelic || true +} + +# vim:set ts=2 sw=2 et: diff --git a/newrelic-sysmond.service b/newrelic-sysmond.service new file mode 100644 index 000000000000..9def14256f1a --- /dev/null +++ b/newrelic-sysmond.service @@ -0,0 +1,11 @@ +[Unit] +Description=System monitor Services Provided by Newrelic +After=network.target + +[Service] +Type=forking +PIDFile=/run/nrsysmond.pid +ExecStart=/usr/bin/nrsysmond -c /etc/newrelic/nrsysmond.cfg -p /run/nrsysmond.pid + +[Install] +WantedBy=multi-user.target |