LibVirtd init script | |
|
|
Senior Mitglied Posts: 216 Registered: 2008-07-04 | The package libvirt installs fine but it misses a init script that could be enabled on boot time that should execute /usr/sbin/libvirtd so the user can use Qemu without having to go to the terminal first and type: sudo libvirtd .............................. OSs: Paldo-testing x86_64 :: HP Pavilion dv9680ez |
|
|
|
|
|
Re: LibVirtd init script | |
|
|
Mitglied Posts: 70 Registered: 2008-08-24 | Yep, it would be useful. I had to write the init script by myself to make qemu work. .............................. Running GNU/Linux Paldo 1.18 (unstable). Rock my box! |
|
|
|
|
|
Re: LibVirtd init script | |
|
|
Senior Mitglied Posts: 216 Registered: 2008-07-04 | Axelgenus, you could post here the init script you've created so any dev can see it and review to integrate on the spec of the package without the need of much more time to create a init script for it .............................. OSs: Paldo-testing x86_64 :: HP Pavilion dv9680ez |
|
|
|
|
|
Re: LibVirtd init script | |
|
|
Mitglied Posts: 70 Registered: 2008-08-24 | Of course I can:
Code | [In neuem Fenster öffnen] | | #!/bin/bash
### BEGIN INIT INFO
# Provides: libvirtd
# Required-Start: $local_fs $network dbus
# Required-Stop: $local_fs $network dbus
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
if [ -e /var/run/libvirtd.pid ]; then
if [ -d /proc/$(cat /var/run/libvirtd.pid) ]; then
echo "virtualization library already started; not starting."
else
echo "Removing stale PID file /var/run/libvirtd.pid."
rm -f /var/run/libvirtd.pid
fi
fi
echo -n "Starting virtualization library daemon: libvirtd"
start_daemon -p /var/run/libvirtd.pid /usr/sbin/libvirtd --daemon
log_success_msg "."
;;
stop)
echo -n "Stopping virtualization library daemon: libvirtd"
killproc -p /var/run/libvirtd.pid /usr/sbin/libvirtd >/dev/null 2>&1
log_success_msg "."
rm -f /var/run/libvirtd.pid
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac |
Put it in /etc/init.d and create a symlink in /var/run/rc to start the daemon at boot time. .............................. Running GNU/Linux Paldo 1.18 (unstable). Rock my box! |
|
|
|
|
|