Mercurial > hg > Applications > virsh-wrapper
changeset 23:66a88f51993f
add libvirtd file for bldsv11
author | taiki |
---|---|
date | Wed, 09 Jul 2014 12:30:12 -1000 |
parents | daa7279b0d78 |
children | e372e7648da0 |
files | ie-vagrant.c ie-virsh.c libvirtd newvm.py |
diffstat | 4 files changed, 52 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/ie-vagrant.c Sat Apr 12 13:28:06 2014 -1000 +++ b/ie-vagrant.c Wed Jul 09 12:30:12 2014 -1000 @@ -14,17 +14,6 @@ #include <regex.h> #include <time.h> - -/******************************************** - * Vagrant Wrapper - Secure Yourself * - * * - * 2007 - Mike Golvach - eggi@comcast.net * - * 2013 - Shinji KONO kono@ie.u-rykyu.ac.jp * - * * - * Usage: COMMAND [init|up|destroy|ssh] * - * * - ********************************************/ - /* Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License */ #define command "/usr/bin/vagrant"
--- a/ie-virsh.c Sat Apr 12 13:28:06 2014 -1000 +++ b/ie-virsh.c Wed Jul 09 12:30:12 2014 -1000 @@ -1,13 +1,4 @@ -/******************************************** - * Virsh Wrapper - Secure Yourself * - * * - * 2007 - Mike Golvach - eggi@comcast.net * - * 2012 - Shinji KONO kono@ie.u-rykyu.ac.jp * - * * - * Usage: COMMAND [start|stop] * - * * - ********************************************/ #include <stdlib.h> #include <unistd.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libvirtd Wed Jul 09 12:30:12 2014 -1000 @@ -0,0 +1,48 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: atd +# Required-Start: $syslog $time $remote_fs +# Required-Stop: $syslog $time $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Deferred execution scheduler +# Description: Debian init script for the atd deferred executions +# scheduler +### END INIT INFO +# +# Author: TaikiTAIRA +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin +DAEMON=/usr/local/sbin/libvirtd +PIDFILE=/usr/local/var/run/libvirtd.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +case "$1" in + start) + log_daemon_msg "Starting libvirt daemon." "libvirt" + start_daemon -p $PIDFILE $DAEMON -d + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping stop libvirt daemon" "libvirt" + killproc -p $PIDFILE $DAEMON + log_end_msg $? + ;; + force-reload|restart) + $0 stop + $0 start + ;; + status) + status_of_proc -p $PIDFILE $DAEMON libvirtd && exit 0 || exit $? + ;; + *) + echo "Usage: /etc/init.d/libvirtd {start|stop|restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0
--- a/newvm.py Sat Apr 12 13:28:06 2014 -1000 +++ b/newvm.py Wed Jul 09 12:30:12 2014 -1000 @@ -24,6 +24,8 @@ return 0 elif re.match('^test/[-a-z0-9]+/0[1-4]$',name): return 0 + elif re.match('^guest/[-a-z0-9]+/0[1-4]$',name): + return 0 else: return 1 @@ -42,6 +44,8 @@ m=re.match('^(teachers/[-a-z0-9]+)/0[1-4]$',name) if m is None: m=re.match('^(test/[-a-z0-9]+)/0[1-4]$',name) + if m is None: + m=re.match('^(guest/[-a-z0-9]+)/0[1-4]$',name) if m is not None: dir=m.group(1) ie_mkdir1('/media/fcs/'+dir)