svn commit: samba r11562 - in trunk/examples/perfcounter: .
jerry at samba.org
jerry at samba.org
Mon Nov 7 22:09:08 GMT 2005
Author: jerry
Date: 2005-11-07 22:09:08 +0000 (Mon, 07 Nov 2005)
New Revision: 11562
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11562
Log:
* change name of perf_writer to perfcount
* add simple init script
* add perfcount binaryy to svn ignore list
Added:
trunk/examples/perfcounter/perfcountd.init
Modified:
trunk/examples/perfcounter/
trunk/examples/perfcounter/Makefile
Changeset:
Property changes on: trunk/examples/perfcounter
___________________________________________________________________
Name: svn:ignore
+ perfcount
Modified: trunk/examples/perfcounter/Makefile
===================================================================
--- trunk/examples/perfcounter/Makefile 2005-11-07 21:41:02 UTC (rev 11561)
+++ trunk/examples/perfcounter/Makefile 2005-11-07 22:09:08 UTC (rev 11562)
@@ -4,7 +4,7 @@
CFLAGS = -g -I$(SAMBA_SRC_DIR)/include -I$(TDB_SRC_DIR)
CC = gcc
-PROGS = perf_writer
+PROGS = perfcount
TDB_OBJ = $(TDB_SRC_DIR)/tdb.o $(TDB_SRC_DIR)/spinlock.o $(TDB_SRC_DIR)/tdbback.o
PERF_WRITER_OBJ = perf_writer.o perf_writer_mem.o perf_writer_util.o perf_writer_cpu.o perf_writer_process.o perf_writer_disk.o
@@ -13,8 +13,8 @@
$(TDB_OBJ):
cd $(TDB_SRC_DIR) && make
-perf_writer: $(PERF_WRITER_OBJ) $(TDB_OBJ)
- $(CC) $(CFLAGS) -o perf_writer $(PERF_WRITER_OBJ) $(TDB_OBJ)
+perfcount: $(PERF_WRITER_OBJ) $(TDB_OBJ)
+ $(CC) $(CFLAGS) -o perfcount $(PERF_WRITER_OBJ) $(TDB_OBJ)
clean:
rm -f $(PROGS) *.o *~ *% core
Added: trunk/examples/perfcounter/perfcountd.init
===================================================================
--- trunk/examples/perfcounter/perfcountd.init 2005-11-07 21:41:02 UTC (rev 11561)
+++ trunk/examples/perfcounter/perfcountd.init 2005-11-07 22:09:08 UTC (rev 11562)
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# This file should have uid root, gid sys and chmod 744
+#
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+killproc() { # kill the named process(es)
+ pid=`ps aux | grep $1 | egrep -v '(grep|perfcountd)' | awk '{print $2}'`
+ if [ "$pid" != "" ]; then
+ kill $pid
+ fi
+}
+
+# Start/stop processes
+
+case "$1" in
+start)
+ /opt/samba/bin/perfcount -d -f /var/lib/samba/perfmon 2> /dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed!"
+ exit 1
+ fi
+ echo "done!"
+ ;;
+stop)
+ killproc perfcount
+ ;;
+
+restart)
+ killproc perfcount
+ /opt/samba/bin/perfcount -d -f /var/lib/samba/perfmon 2> /dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed!"
+ exit 1
+ fi
+
+ echo "done!"
+ ;;
+
+*)
+ echo "Usage: /etc/init.d/samba { start | stop | restart }"
+ ;;
+esac
Property changes on: trunk/examples/perfcounter/perfcountd.init
___________________________________________________________________
Name: svn:executable
+ *
More information about the samba-cvs
mailing list