Skip to content

Instantly share code, notes, and snippets.

@lancechentw
Created June 20, 2013 17:56
Show Gist options
  • Save lancechentw/5825010 to your computer and use it in GitHub Desktop.
Save lancechentw/5825010 to your computer and use it in GitHub Desktop.
Archlinux package rpc-rstatd
--- getdata.c.org 2012-02-15 14:22:05.974589223 +0800
+++ getdata.c 2012-02-15 14:18:47.691624016 +0800
@@ -211,7 +211,10 @@
if (*bufp == '\0')
continue; /* skip empty line */
iface = bufp;
+
+#ifdef DEBUG
syslog(LOG_DEBUG, "interface: %s", iface);
+#endif
/* search for the end of the interface name (':' or \0) */
while (*bufp != ':' && *bufp != '\0') bufp++;
@@ -283,7 +286,7 @@
if (0 == strncmp(u.release, "2.4", 3)) {
getdata.disk = get_disk24;
}
- if (0 == strncmp(u.release, "2.6", 3)) {
+ if (0 == strncmp(u.release, "2.6", 3) || 0 == strncmp(u.release, "3.", 2)) {
getdata.disk = get_disk26;
getdata.vm = get_vm26;
}
# Maintainer: LinuxTA <[email protected]>
# Contributor: Chris Cooper <[email protected]>
# Special thanks to Mark Rosenstand <[email protected]>
# He is the original creator of this, but stopped maintaining.
pkgname=rpc.rstatd
pkgver=4.0.1
pkgrel=2
pkgdesc="Linux Performance Statistics Client and Server"
arch=('i686' 'x86_64')
url="http://rstatd.sourceforge.net/"
license=('GPL2')
depends=('rpcbind')
source=(http://downloads.sourceforge.net/rstatd/$pkgname-$pkgver.tar.gz getdata.c.patch rpc-rstatd.service)
md5sums=('116d9a8a35656e76f16c679d0596519a'
'38d28b800c906896b0ddb129b91d0b6a'
'df26a96145f91c30d1dabcf79f6c0752')
build() {
cd $srcdir/$pkgname-$pkgver
patch -Nup0 < $srcdir/getdata.c.patch
./configure --prefix=/usr --mandir=/usr/share/man --sbindir=/usr/bin
make
}
check() {
cd "$srcdir/$pkgname-$pkgver"
make check
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR=$pkgdir install install-man
# install systemd service file
install -D -m644 $srcdir/rpc-rstatd.service $pkgdir/usr/lib/systemd/system/rpc-rstatd.service
}
[Unit]
Description=Network Remote Performance Statistics Monitor Daemon
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=forking
ExecStart=/usr/bin/rpc.rstatd
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment