SCIENTIFIC-LINUX-USERS Archives

July 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
carlopmart <[log in to unmask]>
Reply To:
carlopmart <[log in to unmask]>
Date:
Mon, 25 Jul 2011 14:46:51 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Hi all,

  I have configured a cron task to start certain virtual machines when 
kvm host starts at a certain runlevel (3 or 4). My script:

#!/bin/sh

which_rulevel=`runlevel | awk '{print $2}'`

if [ "$which_rulevel" == 3 ]; then
	sleep 60
	virsh start vmfw01
	sleep 140
	virsh start vmfw02
elif [ "$which_rulevel" == 4 ]; then
	sleep 60
	virsh start vmfw03
fi

  .. And my cron task is located under /etc/cron.d with the following 
config file:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
HOME=/
@reboot * * * * root /root/bin/launch_vms

  But it doesn't works ... Under cron log I see this message:

Jul 25 14:25:11 srvkvm01 crond[2235]: (CRON) bad command 
(/etc/cron.d/launch_kvms)

  I can't see where is the problem. KVM host is a SL6.1 (but with SL6.0 
doesn't works also)...

  Any help??
-- 
CL Martinez
carlopmart {at} gmail {d0t} com

ATOM RSS1 RSS2