4 # copyright (C) 2014 FUJITSU LIMITED All Rights Reserved
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 LOGFILE="/var/log/lxcf/lxcf-messages"
24 if [ ${EUID:-${UID}} != 0 ]; then
25 echo "error: Because you are not root, you cannot execute this command. "
31 echo "usage: lxcf queue cancel UU-ID"
37 LINE=`cat /var/tmp/lxcf/*queue | egrep "^$UUID"`
40 echo "error: uuid" $UUID "is not exist"
45 flock $1 sed -i "/^$UUID/d" $1
48 TM=`LANG=C date +"%c"`
50 cancel_queue /var/tmp/lxcf/hqueue
51 cancel_queue /var/tmp/lxcf/qqueue
52 cancel_queue /var/tmp/lxcf/lqueue
54 flock $LOGFILE echo "###" $TM "CANCELED :" $LINE "###" >> $LOGFILE
56 echo "Canceled :" $LINE