/etc/qemu-ifup

^c command        ^k delete char    ^f undelete char
===============================================================================
#!/bin/sh
sudo -p "Password for $0" /sbin/ifconfig $1 172.20.0.1

"Password for $0" は パスワードを勝手に打ってくれるコマンドではありません(ぉ

^c command        ^k delete char    ^f undelete char
===============================================================================
#!/bin/sh
sudo /sbin/ifconfig $1 172.20.0.1

visudo で適当に設定してください

Cmnd_Alias  QEMU=/sbin/ifconfig,/usr/sbin/brctl
  
# User privilege specification
root    ALL=(ALL) ALL
ore     ALL=NOPASSWD: QEMU

めんどいので、ore ALL=NOPASSWD: ALL にしてますが。


kqemuは諸般の事情により再配布してないらしい

/etc/rc.local

# Load the KQEMU kernel module
/sbin/modprobe kqemu

http://fabrice.bellard.free.fr/qemu/kqemu-doc.html

を追加

あれ? あるやん rc.local いつの間に(゜Д゜)
これはつかいやすい これはすごい ためになる+90
まぎらわしい これはすごくない ためにならない

/etc/default/rcSを編集するのはコワス

  • # /sbin/modprobe kqemu
  • # /bin/mknod /dev/kqemu c 250 0
  • # chmod 666 /dev/kqemu

起動時に Could not open '/dev/kqemu' - QEMU acceleration layer not activated
が出てる場合は上記のどれかが足りない。


とりあえず使うモジュールを/etc/moduleにかく- /etc/modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
kqemu

/etc/rcS.d/S15module-init-tools -> /etc/init.d/module-init-tools

で呼ばれる

  • /etc/init.d/kqemu
#! /bin/sh
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=kqemu

case "$1" in
  start)
        /sbin/modprobe kqemu
        mknod /dev/kqemu c 250 0
        chmod 666 /dev/kqemu
        ;;
  stop|restart|force-reload)
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

# chmod 755 kqemu
# cd ../rcS.d
# ln -s ../init.d/kqemu S16kqemu

ひょっとして自動生成かけれるところを手作業でやってたりするんかな漏れ(ノд`)
....
追記 2.12
update-rc.d
やっぱり....

#update-rc.d postgres start 90 2 3 4 5 . stop 10 0 1 6 .
これで以下のようなリンクファイルが作成されます。
/etc/rc0.d/K10postgres
/etc/rc1.d/K10postgres
/etc/rc2.d/S90postgres
/etc/rc3.d/S90postgres
/etc/rc4.d/S90postgres
/etc/rc5.d/S90postgres
/etc/rc6.d/K10postgres

http://park15.wakwak.com/~unixlife/linux/de-init.html

(ノД`)