diff --git a/.cvsignore b/.cvsignore index 386537f..6d9ed1b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ -netkit-rusers-0.17-pre20000412.tar.gz +netkit-rusers-0.17.tar.gz rstatd.tar.gz diff --git a/netkit-rusers-0.17-2.4.patch b/netkit-rusers-0.17-2.4.patch new file mode 100644 index 0000000..a2d2031 --- /dev/null +++ b/netkit-rusers-0.17-2.4.patch @@ -0,0 +1,96 @@ +--- netkit-rusers-0.17/rpc.rstatd/rstat_proc.c.2.4 Wed Feb 14 20:54:31 2001 ++++ netkit-rusers-0.17/rpc.rstatd/rstat_proc.c Wed Feb 14 20:55:08 2001 +@@ -385,12 +385,14 @@ + + #if defined(__linux__) + ++#define MAX_DISKS 4 ++ + struct _ldisk { +- unsigned int xfer[4]; +- unsigned int rio[4]; +- unsigned int wio[4]; +- unsigned int rblk[4]; +- unsigned int wblk[4]; ++ unsigned int xfer[MAX_DISKS]; ++ unsigned int rio[MAX_DISKS]; ++ unsigned int wio[MAX_DISKS]; ++ unsigned int rblk[MAX_DISKS]; ++ unsigned int wblk[MAX_DISKS]; + }; + + static void +@@ -401,7 +403,8 @@ + static int stat; + #define BUFFSIZE 1024 + char buff[BUFFSIZE]; +- ++ int ndisks; ++ + if ((stat=open("/proc/stat", O_RDONLY, 0)) != -1) { + char* b; + buff[BUFFSIZE-1] = 0; /* ensure null termination in buffer */ +@@ -410,24 +413,29 @@ + *itot = 0; + *i1 = 1; /* ensure assert below will fail if the sscanf bombs */ + b = strstr(buff, "cpu "); ++ if(b) + sscanf(b, "cpu %lu %lu %lu %lu", cuse, cice, csys, cide); +- b = strstr(buff, "disk "); +- sscanf(b, "disk %u %u %u %u", d->xfer+0, d->xfer+1, d->xfer+2, d->xfer+3); +- b = strstr(buff, "disk_rio "); +- sscanf(b, "disk_rio %u %u %u %u", d->rio+0, d->rio+1, d->rio+2, d->rio+3); +- b = strstr(buff, "disk_wio "); +- sscanf(b, "disk_rio %u %u %u %u", d->wio+0, d->wio+1, d->wio+2, d->wio+3); +- b = strstr(buff, "disk_rblk "); +- sscanf(b, "disk_rblk %u %u %u %u", d->rblk+0,d->rblk+1,d->rblk+2,d->rblk+3); +- b = strstr(buff, "disk_wblk "); +- sscanf(b, "disk_wblk %u %u %u %u", d->wblk+0,d->wblk+1,d->wblk+2,d->wblk+3); ++ b = strstr(buff, "disk_io:"); ++ ndisks = 0; ++ while ( (b = strstr(b, "):")) != NULL && ndisks < MAX_DISKS ) { ++ sscanf (b, "):(%u,%u,%u,%u,%u)", &d->xfer[ndisks], ++ &d->rio[ndisks], &d->rblk[ndisks], ++ &d->wio[ndisks], &d->wblk[ndisks]); ++ ndisks++; ++ b += 2; ++ } ++ + b = strstr(buff, "page "); ++ if(b) + sscanf(b, "page %u %u", pin, pout); + b = strstr(buff, "swap "); ++ if(b) + sscanf(b, "swap %u %u", sin, sout); + b = strstr(buff, "intr "); ++ if(b) + sscanf(b, "intr %u %u", itot, i1); + b = strstr(buff, "ctxt "); ++ if(b) + sscanf(b, "ctxt %u", ct); + assert(*itot>*i1); + } +@@ -477,6 +485,7 @@ + { + switch (procnetdev_vsn) { + case 3: ++ if(bp) + sscanf(bp, + "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", + &ife->stats.rx_bytes, +@@ -498,6 +507,7 @@ + &ife->stats.tx_compressed); + break; + case 2: ++ if(bp) + sscanf(bp, "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", + &ife->stats.rx_bytes, + &ife->stats.rx_packets, +@@ -516,6 +526,7 @@ + ife->stats.rx_multicast = 0; + break; + case 1: ++ if(bp) + sscanf(bp, "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", + &ife->stats.rx_packets, + &ife->stats.rx_errors, diff --git a/rstatd.init b/rstatd.init index 0160671..e9e6994 100755 --- a/rstatd.init +++ b/rstatd.init @@ -18,7 +18,7 @@ then fi start() { - echo -n "Starting rstat services: " + echo -n $"Starting rstat services: " daemon rpc.rstatd RETVAL=$? @@ -28,7 +28,7 @@ start() { } stop() { - echo -n "Stopping rstat services: " + echo -n $"Stopping rstat services: " killproc rpc.rstatd RETVAL=$? @@ -60,7 +60,7 @@ case "$1" in [ -f /var/lock/subsys/rstatd ] && restart || : ;; *) - echo "Usage: rstatd {start|stop|status|restart}" + echo $"Usage: rstatd {start|stop|status|restart}" exit 1 ;; esac diff --git a/rusers.spec b/rusers.spec index 47a307d..f1c39ec 100644 --- a/rusers.spec +++ b/rusers.spec @@ -1,17 +1,16 @@ -%define _snapshot -pre20000412 - Summary: Displays the users logged into machines on the local network. Name: rusers Version: 0.17 -Release: 6 +Release: 10 Copyright: BSD Group: System Environment/Daemons -Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit-devel/netkit-rusers-%{version}%{_snapshot}.tar.gz +Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-rusers-%{version}.tar.gz Source1: rusersd.init Source2: rstatd.tar.gz Source3: rstatd.init Patch0: rstatd-jbj.patch Patch1: netkit-rusers-0.15-numusers.patch +Patch2: netkit-rusers-0.17-2.4.patch Buildroot: %{_tmppath}/%{name}-root %description @@ -26,7 +25,7 @@ local network. %package server Summary: Server for the rusers protocol. Group: System Environment/Daemons -Prereq: /sbin/chkconfig /etc/init.d +Prereq: /sbin/chkconfig Requires: portmap %description server @@ -40,9 +39,10 @@ Install rusers-server if you want remote users to be able to see who is logged into your machine. %prep -%setup -q -n netkit-rusers-%{version}%{_snapshot} -a 2 +%setup -q -n netkit-rusers-%{version} -a 2 %patch0 -p1 -b .jbj %patch1 -p1 -b .numusers +%patch2 -p1 -b .2.4 %build sh configure @@ -99,6 +99,18 @@ fi %changelog +* Wed Feb 14 2001 Nalin Dahyabhai +- merge in Bob Matthews' patch, which solves other parts on 2.4 (#26447) + +* Tue Feb 6 2001 Nalin Dahyabhai +- don't die if /proc/stat looks a little odd (#25519) + +* Mon Feb 5 2001 Bernhard Rosenkraenzer +- i18nize rstatd init script + +* Tue Jan 24 2001 Nalin Dahyabhai +- gettextize init script + * Sat Aug 05 2000 Bill Nottingham - condrestart fixes diff --git a/rusersd.init b/rusersd.init index 8566d87..eae517e 100755 --- a/rusersd.init +++ b/rusersd.init @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/bash # # chkconfig: - 60 20 # description: The rusers protocol allows users on a network to identify \ @@ -23,7 +23,7 @@ start() { status portmap > /dev/null RETVAL=$? [ $RETVAL -ne 0 ] && /etc/rc.d/init.d/portmap start - echo -n "Starting rusers services: " + echo -n $"Starting rusers services: " daemon rpc.rusersd RETVAL=$? echo @@ -32,7 +32,7 @@ start() { } stop() { - echo -n "Stopping rusers services: " + echo -n $"Stopping rusers services: " killproc rpc.rusersd RETVAL=$? echo @@ -63,7 +63,7 @@ case "$1" in [ -f /var/lock/subsys/rusersd ] && restart || : ;; *) - echo "Usage: rusersd {start|stop|status|restart}" + echo $"Usage: $0 {start|stop|status|restart}" exit 1 ;; esac diff --git a/sources b/sources index 0c4f5d6..cc8ed4d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -332766c20687832602b693448ebcd81a netkit-rusers-0.17-pre20000412.tar.gz +dc99a80b9fde2ab427c874f88f1c1602 netkit-rusers-0.17.tar.gz 10c67f22a94826d6ecdd4b41db4d9946 rstatd.tar.gz