This file is indexed.

/usr/sbin/dtc_kill_vps_disk is in dtc-xen 0.5.17-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh

if [ $# -lt 1 ]; then 
	echo "Usage: $0 <xen id> [lvm/vbd]"
	exit
fi

# Things that often change

# Source the configuration in the config file!
if [ -f /etc/dtc-xen/dtc-xen.conf ] ; then
	. /etc/dtc-xen/dtc-xen.conf
fi

# Figure out the VPS mount point
if [ -n "$provisioning_mount_point" ]
then
	VPSGLOBPATH="$provisioning_mount_point"
else
	VPSGLOBPATH="$VPS_MOUNTPOINT"
fi

# Things that most of then time don't change
VPSNUM=$1
VPSNAME=xen${VPSNUM}
VPSHOSTNAME=xen${NODE_NUM}${VPSNUM}
IMAGE_TYPE=$2

if [ -z "$IMAGE_TYPE" ] ; then IMAGE_TYPE=lvm ; fi

# Figure out the LVM name from dtc-xen.conf
if [ "$IMAGE_TYPE" = "lvm" ] ; then
	LVMNAME=`dtc-xen-volgroup`
	[ -z "$LVMNAME" ] && {
		echo "Could not determine volume group from which to provision the volume" 1>&2
		echo "You might want to set provisioning_volgroup in dtc-xen.conf" 1>&2
		exit 78
	}
fi
FSTAB_LVMNAME=`echo ${LVMNAME} | sed -e 's/-/--/g'`

# redirect stdout and stderr to log files, so we can see what happened during install

echo "Redirecting standard output to $VPSGLOBPATH/$VPSNUM.stdout..."
echo "Redirecting standard error to $VPSGLOBPATH/$VPSNUM.stderr..."
if [ -e $VPSGLOBPATH/$VPSNUM.setuplvm.stdout ]; then
        mv $VPSGLOBPATH/$VPSNUM.setuplvm.stdout $VPSGLOBPATH/$VPSNUM.setuplvm.stdout.old
fi
if [ -e $VPSGLOBPATH/$VPSNUM.setuplvm.stderr ]; then
        mv $VPSGLOBPATH/$VPSNUM.setuplvm.stderr $VPSGLOBPATH/$VPSNUM.setuplvm.stderr.old
fi

exec 1>$VPSGLOBPATH/$VPSNUM.setuplvm.stdout
exec 2>$VPSGLOBPATH/$VPSNUM.setuplvm.stderr

if [ -x /sbin/lvcreate -a /sbin/lvremove ] ; then
	LVCREATE=/sbin/lvcreate
	LVREMOVE=/sbin/lvremove
else
	if [ -x /usr/sbin/lvcreate -a /usr/sbin/lvremove ] ; then
		LVCREATE=/usr/sbin/lvcreate
		LVREMOVE=/usr/sbin/lvremove
	else
		echo "Could not find lvcreate and lvremove binaries!" > /dev/stderr
		exit 1
	fi
fi

echo "Seleted ${VPSNAME}";
echo "Destroying disks..."

if [ ""$IMAGE_TYPE = "lvm" ]; then
	# Remove existing partitions if they existed
	if [ -L /dev/${LVMNAME}/${VPSNAME} ] ; then
		$LVREMOVE -f /dev/${LVMNAME}/${VPSNAME}
	fi
	if [ -L /dev/${LVMNAME}/${VPSNAME}swap ] ; then
		$LVREMOVE -f /dev/${LVMNAME}/${VPSNAME}swap
	fi
else
	if [ -e ${VPSGLOBPATH}/${VPSNAME}.img ]; then
		umount ${VPSGLOBPATH}/${VPSNAME}.img
		rm ${VPSGLOBPATH}/${VPSNAME}.img
	fi
	if [ -e ${VPSGLOBPATH}/${VPSNAME}.swap.img ]; then
		umount ${VPSGLOBPATH}/${VPSNAME}.swap.img
		rm ${VPSGLOBPATH}/${VPSNAME}.swap.img
	fi
fi

# Remove the auto start file
if [ -f /etc/xen/auto/${VPSNAME} ] ; then
	rm /etc/xen/auto/${VPSNAME}
fi