ps -e | grep | PROGRAM
или
while true;
do
kill program
done
wait
Вы можете легко получить доступ к функциям C из Python.
#!/usr/bin/env python
import os, sys
from ctypes import *
libc = CDLL('libc.so.6', use_errno=True)
MNT_EXPIRE = 4
libc.umount2(c_char_p(sys.argv[1]), c_int(MNT_EXPIRE))
if get_errno() != 0:
print os.strerror(get_errno())
exit(1)