Mohammed Morsi
2009-May-08 15:05 UTC
[Ovirt-devel] [PATCH node] add anyterm to node requirements and setup on startup
adds anyterm rpm dependency to ovirt node spec and sets up anyterm on node instantation by setting the service to start by default and making the necessary anyterm sysconfig changes --- ovirt-node.spec.in | 1 + scripts/ovirt-functions | 12 ++++++++++++ scripts/ovirt-install-node-stateful | 2 ++ scripts/ovirt-install-node-stateless | 2 ++ 4 files changed, 17 insertions(+), 0 deletions(-) diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index 1a73066..1b847c5 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -42,6 +42,7 @@ Requires: qemu-img Requires: nc Requires: grub Requires: /usr/sbin/crond +Requires: anyterm ExclusiveArch: %{ix86} x86_64 %define app_root %{_datadir}/%{name} diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index e89898d..6ce5ffc 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -201,6 +201,18 @@ ovirt_setup_libvirtd() { fi } +ovirt_setup_anyterm() { + # configure anyterm + sed -i -e 's/^# ANYTERM_CMD=\/usr\/bin\/anyterm-cmd/ANYTERM_CMD="sudo /usr/bin/virsh console %p"/' \ + /etc/sysconfig/anyterm + + sed -i -e 's/^# ANYTERM_LOCAL_ONLY=true/ANYTERM_LOCAL_ONLY=false/' \ + /etc/sysconfig/anyterm + + # permit it to run the virsh console + echo "anyterm ALL=NOPASSWD: /usr/bin/virsh console *" >> /etc/sudoers +} + md5() { md5sum $1 2>/dev/null | (read MD5 filename; echo $MD5) } diff --git a/scripts/ovirt-install-node-stateful b/scripts/ovirt-install-node-stateful index 3ec1c29..9426c81 100755 --- a/scripts/ovirt-install-node-stateful +++ b/scripts/ovirt-install-node-stateful @@ -75,6 +75,7 @@ chkconfig libvirt-qpid on chkconfig iptables on chkconfig ntpdate on chkconfig ntpd on +chkconfig anyterm on backup_file /etc/sysconfig/libvirtd backup_file /etc/libvirt/qemu.conf @@ -82,6 +83,7 @@ backup_file /etc/libvirt/libvirtd.conf backup_file /etc/sasl2/libvirt.conf backup_file /etc/krb5.conf ovirt_setup_libvirtd +ovirt_setup_anyterm backup_file /etc/sysconfig/iptables # We open up anything coming from ovirtbr0 to this node, since it diff --git a/scripts/ovirt-install-node-stateless b/scripts/ovirt-install-node-stateless index 705c491..cceb048 100755 --- a/scripts/ovirt-install-node-stateless +++ b/scripts/ovirt-install-node-stateless @@ -20,8 +20,10 @@ chkconfig --level 3 ovirt-early on chkconfig --level 3 ovirt on chkconfig --level 3 ovirt-post on chkconfig --level 3 collectd on +chkconfig --level 3 anyterm on ovirt_setup_libvirtd +ovirt_setup_anyterm # make sure we don't autostart virbr0 on libvirtd startup rm -f /etc/libvirt/qemu/networks/autostart/default.xml -- 1.6.0.6