summaryrefslogtreecommitdiff
path: root/sysutils/swapd/files
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2005-02-20 13:56:09 +0000
committerxtraeme <xtraeme@pkgsrc.org>2005-02-20 13:56:09 +0000
commitb43e8951d44069a2119cfbd06ef82a6957edc699 (patch)
tree92ab74ab02e7cb24b3257c17a8c805996fcffa45 /sysutils/swapd/files
parent1526c422945167547d8505ba428fc098becae422 (diff)
downloadpkgsrc-b43e8951d44069a2119cfbd06ef82a6957edc699.tar.gz
Update to 1.0.3
Made the free/used memory polling time configurable through the "delay" option. pkgsrc changes: modified the rc.d script to work on systems without the NetBSD's rc.d system.
Diffstat (limited to 'sysutils/swapd/files')
-rw-r--r--sysutils/swapd/files/swapd.sh43
1 files changed, 39 insertions, 4 deletions
diff --git a/sysutils/swapd/files/swapd.sh b/sysutils/swapd/files/swapd.sh
index f32a52ecfa0..c33c5a24214 100644
--- a/sysutils/swapd/files/swapd.sh
+++ b/sysutils/swapd/files/swapd.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: swapd.sh,v 1.3 2004/11/29 16:19:19 xtraeme Exp $
+# $NetBSD: swapd.sh,v 1.4 2005/02/20 13:56:09 xtraeme Exp $
#
# PROVIDE: swapd
# REQUIRE: DAEMON LOGIN
@@ -12,10 +12,45 @@ required_files="@PKG_SYSCONFDIR@/${name}.conf"
pidfile="@VARBASE@/run/${name}.pid"
sig_stop="KILL"
-. /etc/rc.subr
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
-load_rc_config $name
-run_rc_command "$1"
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ case ${1:-start} in
+ start)
+ if [ -x ${command} ]; then
+ echo "Starting ${command}."
+ eval ${command} ${distccd_flags} ${command_args}
+ fi
+ ;;
+ stop)
+ if [ -f ${pidfile} ]; then
+ pid=`/bin/head -1 ${pidfile}`
+ echo "Stopping ${name}."
+ kill -${sig_stop} ${pid}
+ else
+ echo "${name} not running?"
+ fi
+ ;;
+ restart)
+ ( $0 stop )
+ sleep 1
+ $0 start
+ ;;
+ status)
+ if [ -f ${pidfile} ]; then
+ pid=`/bin/head -1 ${pidfile}`
+ echo "${name} is running as pid ${pid}."
+ else
+ echo "${name} is not running."
+ fi
+ ;;
+ esac
+fi
if [ "$1" != "stop" -o "$1" != "status" ]; then
echo $(check_process $command) > $pidfile