Subject: Re: xentools20 updated to 2.0.6
To: None <port-xen@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: port-xen
Date: 05/24/2005 09:00:48
On Tue, 24 May 2005 05:52:18 +0200
Juan RP <juan@xtrarom.org> wrote:

> More things to do:
> 
> 	* Check for /kern/xen/privcmd in the rc.d/xend script, so that
>           we start it safely (otherwise we'll see some weird errors
>           when we aren't using NetBSD/Xen).

Done, here it goes:


Index: files/xend.sh
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/xentools20/files/xend.sh,v
retrieving revision 1.2
diff -u -r1.2 xend.sh
--- files/xend.sh       1 Apr 2005 19:06:12 -0000       1.2
+++ files/xend.sh       24 May 2005 07:00:04 -0000
@@ -5,8 +5,7 @@
 # PROVIDE: xend
 # REQUIRE: disks network
 
-if [ -f /etc/rc.subr ]
-then
+if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
 fi
 
@@ -14,7 +13,16 @@
 rcvar=$name
 command="@PREFIX@/sbin/xend"
 command_interpreter="@RCD_INTERPRETER@"
-start_cmd="echo starting ${name}. && ${command} start"
+start_cmd="@ECHO@ Starting ${name}. && ${command} start"
+start_precmd="test_kern_privcmd"
+
+test_kern_privcmd()
+{
+       if [ ! -f /kern/xen/privcmd ]; then
+               @ECHO@ "${name}: Cannot find /kern/xen/privcmd!"
+               exit 1
+       fi
+}
 
 load_rc_config $name
 run_rc_command "$1"