diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2006-03-29 12:03:54 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2006-03-29 12:03:54 +0000 |
commit | bc4d4290f5c24cf8a3e620c99ddd0a06da3497c9 (patch) | |
tree | 89b0846134c419f6fde2087de20ba1d3ce94a558 /sysutils/nut22/files | |
parent | ce0e009c28d60bf9031d8c0f3775ec48307e9e0d (diff) |
Notes
Diffstat (limited to 'sysutils/nut22/files')
-rw-r--r-- | sysutils/nut22/files/nut.sh.in (renamed from sysutils/nut22/files/nut.sh.sample) | 23 | ||||
-rw-r--r-- | sysutils/nut22/files/nut_upslog.sh.in | 36 | ||||
-rw-r--r-- | sysutils/nut22/files/nut_upsmon.sh.in | 34 | ||||
-rw-r--r-- | sysutils/nut22/files/patch-Makefile.in | 14 | ||||
-rw-r--r-- | sysutils/nut22/files/patch-drivers_Makefile.in | 11 |
5 files changed, 95 insertions, 23 deletions
diff --git a/sysutils/nut22/files/nut.sh.sample b/sysutils/nut22/files/nut.sh.in index 85638b71c5af..9cd40c1430b5 100644 --- a/sysutils/nut22/files/nut.sh.sample +++ b/sysutils/nut22/files/nut.sh.in @@ -17,33 +17,28 @@ # nut_enable=${nut_enable-"NO"} nut_prefix=${nut_prefix-"%%PREFIX%%"} -nut_pidfile=${nut_pidfile-"%%STATEDIR%%/nut.pid"} -nut_upslog=${nut_upslog-"/var/log/ups.log"} -nut_upsloginterval=${nut_upsloginterval-"300"} -nut_upslogmail=${nut_upslogmail-"backups@localhost"} . %%RC_SUBR%% name="nut" rcvar=`set_rcvar` +load_rc_config $name + required_dirs="%%STATEDIR%%" -required_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users ${nut_prefix}/etc/nut/upsmon.conf" +required_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users" +command="${nut_prefix}/sbin/upsd" +pidfile="%%STATEDIR%%/upsd.pid" -start_postcmd="nut_start" -stop_cmd="nut_stop" +start_precmd="nut_prestart" +stop_postcmd="nut_poststop" -nut_start() { +nut_prestart() { ${nut_prefix}/libexec/nut/upsdrvctl start - ${nut_prefix}/sbin/upsd - ${nut_prefix}/sbin/upsmon localhost - ${nut_prefix}/bin/upslog -s ${nut_upslogmail} -l ${nut_upslog} -i ${nut_upsloginterval} } -nut_stop() { - /usr/bin/killall upslog upsmon upsd +nut_poststop() { ${nut_prefix}/libexec/nut/upsdrvctl stop } -load_rc_config $name run_rc_command "$1" diff --git a/sysutils/nut22/files/nut_upslog.sh.in b/sysutils/nut22/files/nut_upslog.sh.in new file mode 100644 index 000000000000..908451b9c331 --- /dev/null +++ b/sysutils/nut22/files/nut_upslog.sh.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nut_upslog +# REQUIRE: NETWORKING nut +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Define these nut_upslog* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/nut_upslog +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +nut_upslog_enable=${nut_upslog_enable-"NO"} +nut_upslog_prefix=${nut_upslog_prefix-"%%PREFIX%%"} +nut_upslog_logfile=${nut_upslog_logfile-"/var/log/ups.log"} +nut_upslog_interval=${nut_upslog_interval-"300"} +nut_upslog_ups=${nut_upslog_ups-"myups@localhost"} + +. %%RC_SUBR%% + +name="nut_upslog" +rcvar=`set_rcvar` + +load_rc_config $name + +required_dirs="%%STATEDIR%%" +command="${nut_upslog_prefix}/bin/upslog" +pidfile="%%STATEDIR%%/upslog.pid" +nut_upslog_flags=${nut_upslog_flags-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"} + +run_rc_command "$1" diff --git a/sysutils/nut22/files/nut_upsmon.sh.in b/sysutils/nut22/files/nut_upsmon.sh.in new file mode 100644 index 000000000000..5d5449dc3204 --- /dev/null +++ b/sysutils/nut22/files/nut_upsmon.sh.in @@ -0,0 +1,34 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: nut_upsmon +# REQUIRE: NETWORKING nut +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Define these nut_upsmon* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/nut_upsmon +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +nut_upsmon_enable=${nut_upsmon_enable-"NO"} +nut_upsmon_prefix=${nut_upsmon_prefix-"%%PREFIX%%"} + +. %%RC_SUBR%% + +name="nut_upsmon" +rcvar=`set_rcvar` + +load_rc_config $name + +required_dirs="%%STATEDIR%%" +required_files="${nut_upsmon_prefix}/etc/nut/upsmon.conf" +command="${nut_upsmon_prefix}/sbin/upsmon" +pidfile="%%STATEDIR%%/upsmon.pid" +nut_upsmon_flags=${nut_upsmon_flags-"localhost"} + +run_rc_command "$1" diff --git a/sysutils/nut22/files/patch-Makefile.in b/sysutils/nut22/files/patch-Makefile.in index 313109b69c9c..72832e15e229 100644 --- a/sysutils/nut22/files/patch-Makefile.in +++ b/sysutils/nut22/files/patch-Makefile.in @@ -1,5 +1,5 @@ ---- Makefile.in.orig Thu Jan 27 15:33:15 2005 -+++ Makefile.in Fri Jul 8 21:45:32 2005 +--- Makefile.in.orig Mon Oct 10 04:12:51 2005 ++++ Makefile.in Thu Feb 23 19:44:12 2006 @@ -90,6 +90,12 @@ install-cgi-conf: @cd conf; $(MAKE) install-cgi-conf; cd ..; @@ -13,19 +13,15 @@ install-lib: @cd clients; $(MAKE) install-lib; cd ..; @cd man; $(MAKE) install-lib-man; cd ..; -@@ -98,9 +104,8 @@ +@@ -98,6 +104,7 @@ usb: build-usb build-usb: -- @cd drivers; $(MAKE) hidups; cd ..; -- @cd drivers; $(MAKE) newhidups; cd ..; -- @cd drivers; $(MAKE) energizerups; cd ..; + @cd common ; $(MAKE) || exit 1; cd ..; -+ @cd drivers; $(MAKE) newhidups || exit 1; cd ..; + @cd drivers; $(MAKE) build-usb; cd ..; install-usb: - @cd drivers; $(MAKE) install-usb; cd ..; -@@ -109,7 +114,8 @@ +@@ -107,7 +114,8 @@ snmp: build-snmp build-snmp: diff --git a/sysutils/nut22/files/patch-drivers_Makefile.in b/sysutils/nut22/files/patch-drivers_Makefile.in new file mode 100644 index 000000000000..5ef287b7ee51 --- /dev/null +++ b/sysutils/nut22/files/patch-drivers_Makefile.in @@ -0,0 +1,11 @@ +--- drivers/Makefile.in.orig Thu Feb 23 19:38:14 2006 ++++ drivers/Makefile.in Thu Feb 23 19:38:43 2006 +@@ -8,7 +8,7 @@ + + # other definitions + CC = @CC@ +-CFLAGS = -I../include @CFLAGS@ ++CFLAGS = -I../include @CFLAGS@ @LIBUSB_CFLAGS@ + PROGS = bestups fentonups apcsmart everups belkin masterguard powercom \ + cyberpower tripplite victronups genericups mge-utalk bestuferrups \ + isbmex etapro liebert sms esupssmart tripplitesu blazer safenet \ |