+++ /dev/null
-#!/bin/bash
-
-# Copyright 2012 Peter Palfrader
-
-l=/var/run/reboot-lock
-exec 3> $l
-
-if ! flock --exclusive -w 0 3; then
- echo 2>&1 "Cannot acquire reboot lock."
- exit 1
-fi
-echo "Reboot lock acquired."
-
-ppid="$PPID"
-(
- while kill -0 "$ppid" 2>/dev/null; do
- sleep 1
- done
-) &
-disown
-exit 0
--- /dev/null
+#!/bin/sh
+
+KVMCOUNT=`pgrep -cx '^(qemu-)?kvm$'`
+if [ $KVMCOUNT != 0 ]; then
+ echo "Found $KVMCOUNT qemu-kvm instances running, aborting $MOLLYGUARD_CMD!"
+ exit 1
+fi
--- /dev/null
+#!/bin/bash
+
+# Copyright 2012 Peter Palfrader
+
+l=/var/run/reboot-lock
+exec 3> $l
+
+if ! flock --exclusive -w 0 3; then
+ echo 2>&1 "Cannot acquire reboot lock."
+ exit 1
+fi
+echo "Reboot lock acquired."
+
+ppid="$PPID"
+(
+ while kill -0 "$ppid" 2>/dev/null; do
+ sleep 1
+ done
+) &
+disown
+exit 0
'less',
'lsb-release',
'libfilesystem-ruby1.8',
- 'molly-guard',
'mtr-tiny',
'nload',
'pciutils',
}
}
+
+ package { 'molly-guard':
+ ensure => installed,
+ }
+ file { '/etc/molly-guard/run.d/10-check-kvm':
+ mode => '0755',
+ source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
+ require => Package['molly-guard'],
+ }
+ file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
+ mode => '0755',
+ source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
+ require => Package['molly-guard'],
+ }
+
# This really means 'not wheezy'
if $::debarchitecture != 'armhf' {
source => 'puppet:///modules/debian-org/rc.local',
notify => Exec['rc.local start'],
}
- file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
- mode => '0755',
- source => 'puppet:///modules/debian-org/molly-guard-acquire-reboot-lock',
- require => Package['molly-guard'],
- }
file { '/etc/dsa':
ensure => directory,
mode => '0755',