udev入れたのに MACアドレス指定していなかった。で eth# が無いとエラー。 /etc/udev/rules.d/z25_persistent-net.rules を消すという姑息な手段で逃げる。ちょっと長くなるけど uml_switch の起動スクリプト。debian のものをちょこっと変更しただけ。
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/uml_switch
NAME=uml_switch
DESC="User-mode networking switch"
PIDFILE_0=/var/run/uml-utilities/$NAME.0.pid
PIDFILE_1=/var/run/uml-utilities/$NAME.1.pid
PIDFILE_2=/var/run/uml-utilities/$NAME.2.pid
test -x $DAEMON || exit 0
set -e
UML_SWITCH_USER="uml-net"
UML_SWITCH_CTL_0="/var/run/uml-utilities/switch.0"
UML_SWITCH_CTL_1="/var/run/uml-utilities/switch.1"
UML_SWITCH_CTL_2="/var/run/uml-utilities/switch.2"
OPTIONS_0="-tap tap0 -hub -unix $UML_SWITCH_CTL_0"
OPTIONS_1="-hub -unix $UML_SWITCH_CTL_1"
OPTIONS_2="-hub -unix $UML_SWITCH_CTL_2"
case "$1" in
start)
echo -n "Starting $DESC: "
if [ "x$UML_SWITCH_START" = "xfalse" ] ; then
echo " Disabled."
exit 0
else
echo -n " $NAME"
fi
for i in 0 1 2; do
eval start-stop-daemon --start --quiet --pidfile \$PIDFILE_${i} \
--make-pidfile --background --chuid \$UML_SWITCH_USER \
--exec $DAEMON -- \$OPTIONS_${i}
WAIT=5
while ! eval test -e \$UML_SWITCH_CTL_${i}; do
sleep 1
WAIT=$(($WAIT - 1))
if [ $WAIT -le 0 ]; then
eval echo "\$DAEMON never created control socket \$UML_SWITCH_CTL_${i}" >&2
exit 1
fi
done
eval chmod 777 \$UML_SWITCH_CTL_${i}
done
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
for i in 0 1 2; do
eval start-stop-daemon --stop --quiet --pidfile \$PIDFILE_${i} \
--oknodo --exec \$DAEMON
eval rm -f \$PIDFILE_${i} \$UML_SWITCH_CTL_${i}
done
echo "."
done
echo "."
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
更に同じディレクトリに linux というバイナリがある前提の起動用
if [ -z $1 ]; then
echo "what number?" 1>&2
exit
fi
nohup ./linux \
ubda=rootfs_$1 \
ubdb=swap_$1 \
mem=64m \
eth0=daemon,26:4b:fb:b7:fb:0${1},,/var/run/uml-utilities/switch.0 \
eth1=daemon,26:4b:fb:b7:fb:1${1},,/var/run/uml-utilities/switch.1 \
eth2=daemon,26:4b:fb:b7:fb:2${1},,/var/run/uml-utilities/switch.2 \
con0=null > uml_${1}.log 2>&1 &
いや、
こんなこと や dhcp の冗長とかやってみたくて...
0 件のコメント:
コメントを投稿