/usr/bin/killm is in ion 3.2.1+dfsg-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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | #!/bin/bash
# shell script to remove all of my IPC keys
# Modified by Robert Martin to work on Mac 10.4, due to IPCS requiring sudo to list any
# shared memory usage, even if you own it; also modified using Jim Wyllie's "kill
# all related processes" idea
ION_OPEN_SOURCE=1
OS_VERS=""
NOT_KILLED=""
PS_LIST=""
KILLPROCESSLIST="acsadmin lt-acsadmin \
acslist lt-acslist \
aoslsi lt-aoslsi \
aoslso lt-aoslso \
bpadmin lt-bpadmin \
bpcancel lt-bpcancel \
bpchat lt-bpchat \
bpclock lt-bpclock \
bpcounter lt-bpcounter \
bpdriver lt-bpdriver \
bpecho lt-bpecho \
bping lt-bping \
bplist lt-bplist \
bprecvfile lt-bprecvfile \
bpsendfile lt-bpsendfile \
bpsink lt-bpsink \
bpsource lt-bpsource \
bpstats lt-bpstats \
bpstats2 lt-bpstats2 \
bptrace lt-bptrace \
brsccla lt-brsccla \
brsscla lt-brsscla \
bssadmin lt-bssadmin \
bsscounter lt-bsscounter \
bssdriver lt-bssdriver \
bssfw lt-bssfw \
bssrecv lt-bssrecv \
bssStreamingApp lt-bssStreamingApp \
dccpcli lt-dccpcli \
dccpclo lt-dccpclo \
dccplsi lt-dccplsi \
dccplso lt-dccplso \
dgr2file lt-dgr2file \
dgrcla lt-dgrcla \
dtn2admin lt-dtn2admin \
dtn2adminep lt-dtn2adminep \
dtn2fw lt-dtn2fw \
dtpcreceive lt-dtpcreceive \
dtpcsend lt-dtpcsend \
dtpcadmin lt-dtpcadmin \
file2dgr lt-file2dgr \
file2sdr lt-file2sdr \
file2sm lt-file2sm \
file2tcp lt-file2tcp \
file2udp lt-file2udp \
hmackeys lt-hmackeys \
imcadmin lt-imcadmin \
imcfw lt-imcfw \
ionadmin lt-ionadmin \
ionsecadmin lt-ionsecadmin \
ionwarn lt-ionwarn \
ipnadmin lt-ipnadmin \
ipnadminep lt-ipnadminep \
ipnfw lt-ipnfw \
lgagent lt-lgagent \
lgsend lt-lgsend \
ltpadmin lt-ltpadmin \
ltpcli lt-ltpcli \
ltpclo lt-ltpclo \
ltpclock lt-ltpclock \
ltpcounter lt-ltpcounter \
ltpdriver lt-ltpdriver \
ltpmeter lt-ltpmeter \
owltsim lt-owltsim \
owlttb lt-owlttb \
psmshell lt-psmshell \
psmwatch lt-psmwatch \
ramsgate lt-ramsgate \
rfxclock lt-rfxclock \
sdatest lt-sdatest \
sdr2file lt-sdr2file \
sdrmend lt-sdrmend \
sdrwatch lt-sdrwatch \
sm2file lt-sm2file \
smlistsh lt-smlistsh \
stcpcli lt-stcpcli \
stcpclo lt-stcpclo \
tcp2file lt-tcp2file \
tcpcli lt-tcpcli \
tcpclo lt-tcpclo \
udp2file lt-udp2file \
udpcli lt-udpcli \
udpclo lt-udpclo \
udplsi lt-udplsi \
udplso lt-udplso \
ionrestart lt-ionrestart \
"
if [ "$ION_OPEN_SOURCE" == "1" ];then
KILLPROCESSLIST="${KILLPROCESSLIST} \
amsbenchr lt-amsbenchr \
amsbenchs lt-amsbenchs \
amsd lt-amsd \
amshello lt-amshello \
amslog lt-amslog \
amslogprt lt-amslogprt \
amsshell lt-amsshell \
amsstop lt-amsstop \
bputa lt-bputa \
cfdpadmin lt-cfdpadmin \
cfdpclock lt-cfdpclock \
cfdptest lt-cfdptest \
bpcp lt-bpcp\
bpcpd lt-bpcpd\
"
fi
sw_vers 2> /dev/null > /dev/null
#if sw_vers ran, then we're on a mac system
if [[ ! $? ]]; then
OS_VERS=`sw_vers | grep 10.4`
fi
OSNAME=`uname`
if [ "$OSNAME" == "SunOS" ]; then
killcmd="pkill"
else
killcmd="killall"
fi
echo "Sending TERM to ${KILLPROCESSLIST}..."
for THECOMMAND in ${KILLPROCESSLIST}; do
$killcmd "${THECOMMAND}" &> /dev/null
done
sleep 2
echo "Sending KILL to the processes..."
for THECOMMAND in ${KILLPROCESSLIST}; do
$killcmd -KILL "${THECOMMAND}" &> /dev/null
done
sleep 2
echo "Checking if all processes ended..."
for THECOMMAND in ${KILLPROCESSLIST}; do
NOT_KILLED=`ps -e | grep "${THECOMMAND}" | grep -v grep | wc -l`
if [ "$NOT_KILLED" -gt 0 ]; then
echo "Unknown error: process '${THECOMMAND}' not killed...try rebooting?"
fi
done
echo "Deleting shared memory to remove SDR..."
if [[ -z "$OS_VERS" ]]; then
# For mac 10.5 and Linux
for Q in `ipcs -q | grep $USER | awk '{ print $2 }'`; do ipcrm -q $Q; done
for M in `ipcs -m | grep $USER | awk '{ print $2 }'`; do ipcrm -m $M; done
for S in `ipcs -s | grep $USER | awk '{ print $2 }'`; do ipcrm -s $S; done
else
# For mac 10.4, since ipcs on it is weird.
echo "Since ipcs on Apple OSX 10.4 is weird, this script (killm) needs to use sudo, and will ask for your password"
for Q in `sudo ipcs -q | grep $USER | awk '{ print $3 }'`; do ipcrm -Q $Q; done
for M in `sudo ipcs -m | grep $USER | awk '{ print $3 }'`; do ipcrm -M $M; done
for S in `sudo ipcs -s | grep $USER | awk '{ print $3 }'`; do ipcrm -S $S; done
fi
echo "Killm completed."
|