[DRBD-cvs] scripts by lars; .: added trustix to "known" distros user...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Sun, 22 Feb 2004 21:42:50 +0100 (CET)


DRBD CVS committal

Author  : lars
Project : drbd
Module  : scripts

Dir     : drbd/scripts


Modified Files:
	Makefile drbd 


Log Message:
.: added trustix to "known" distros
user: exculde default "do not change" value
      from range check for sync-nice
scripts: removed absolute path from logger

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/scripts/Makefile,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- Makefile	24 Jan 2004 10:43:16 -0000	1.14
+++ Makefile	22 Feb 2004 20:42:45 -0000	1.15
@@ -42,13 +42,16 @@
   INITD=etc/rc.d/init.d/
 endif
 
+ifeq ($(INITD),,)
+   $(warning Can not guess distribution INITD, please fix Makefile.vars)
+   $(warning Assume INITD=etc/init.d according to LSB)
+   INITD=etc/init.d
+endif
 
 all:
 	ln -sf drbd datadisk
 
 install:
-	$(if $(DIST),,\
-	  $(error Can not guess distribution, please fix Makefile.vars))
 	mkdir -p $(PREFIX)etc/ha.d/resource.d
 	install -D -m 755 drbd $(PREFIX)$(INITD)/drbd
 	@ if [ ! -e $(PREFIX)etc/drbd.conf ]; then \
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/scripts/drbd,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- drbd	8 Feb 2004 19:39:57 -0000	1.53
+++ drbd	22 Feb 2004 20:42:45 -0000	1.54
@@ -62,7 +62,7 @@
 #
 # shouldn't there be more descriptive comments? ;)
 #
-CVSID='$Id: drbd,v 1.53 2004/02/08 19:39:57 phil Exp $'
+CVSID='$Id: drbd,v 1.54 2004/02/22 20:42:45 lars Exp $'
 CONTACT='Lars Ellenberg <l.g.e@web.de>, drbd-user@lists.linbit.com'
 
 ##################################################}}}1
@@ -157,9 +157,11 @@
 link=${link%.sh}
 link=${link#rc}
 
-if [ -x /bin/logger ]; then
-	LOGECHO="/bin/logger -t "$link" -s -p user.notice"
-	LOGERR="/bin/logger -t "$link" -s -p user.err"
+type -P logger &>/dev/null && HAVE_LOGGER=true || HAVE_LOGGER=false
+
+if $HAVE_LOGGER ; then
+	LOGECHO="logger -t "$link" -s -p user.notice"
+	LOGERR="logger -t "$link" -s -p user.err"
 else
 	LOGECHO="echo $link:"
 	LOGERR="echo $link:"
@@ -347,8 +349,8 @@
 {
 	local lev=$1 tmp=$2 s=-s; shift 2
 	tmp=$(printf -- "$tmp\n" "$@")
-	if [ "$lev" -eq 1 -a -x /bin/logger ]; then
-		/bin/logger -t "$link" -p user.notice "$tmp"
+	if [ "$lev" -eq 1 ] && $HAVE_LOGGER ; then
+		logger -t "$link" -p user.notice "$tmp"
 	fi
 	[ "$lev" -le "$VERBOSITY" ] || return 0
 	echo "<$lev> $tmp" >&2
@@ -385,8 +387,8 @@
 	# if logger is present, this goes to syslog and stderr
 	# if not, this goes to stderr only
 	echo
-	if [ -x /bin/logger ] ; then
-		exec > >(/bin/logger -s -t drbd -p user.err) 
+	if $HAVE_LOGGER ; then
+		exec > >(logger -s -t drbd -p user.err) 
 	else
 		exec 1>&2
 	fi