File: ipcfree

package info (click to toggle)
pvm 3.4.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,284 kB
  • sloc: ansic: 72,074; makefile: 1,198; fortran: 631; sh: 285; csh: 74; asm: 37
file content (32 lines) | stat: -rwxr-xr-x 656 bytes parent folder | download | duplicates (12)
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
#!/bin/sh
#
# $Id: ipcfree,v 1.2 1999/02/17 16:43:10 pvmsrc Exp $
#
# ipcfree
#
# Delete any shared memory, semaphores and message queues lying around after 
# a PVM
# program bombs out or is killed ungracefully.
# Run it if you're getting error messages like:
#   semget: ... No space left on device
#   shmget: ... No space left on device
# when using one of the *MP PVM architectures.
# Or when using the pvm_shmd shared memory daemon.
#

if [ "$USER" = "" ]; then
	USER=` whoami `
fi

m=` ipcs | awk '$1~/^[msq]$/ && $5~/'$USER'/ {print "-"$1, $2}' `

case "$m" in
?*) echo "deleting $m"
    ipcrm $m
;;
*) echo "didn't find anything"
;;
esac

exit 0