kill proccess from script

kill proccess from script

Post by tony » Wed, 27 Oct 1999 04:00:00



I have a answering machine setup on my linux. When activated
(no lock file is produced) my dialup cannot access the
modem. I want to write a script to start my ppp dial-up.
What I need to know is how kill the answer machine interface
(spk) from my script (bash shell). Is there a way to do this
with only the name (spk) of the proccess? Or do I have to
find the proccess id number someway? Once I do this I would
then dial up my ISP (I know how to do this in a script). I
just need to kill "spk" (name of proccess) from my script.
An example would be very helpful.

Thanks in advance

 
 
 

kill proccess from script

Post by Rick Ell » Thu, 28 Oct 1999 04:00:00




>Is there a way to do this
>with only the name (spk) of the proccess?

man killall

--
http://www.fnet.net/~ellis/photo/linux.html

 
 
 

kill proccess from script

Post by Marc SCHAEFE » Thu, 28 Oct 1999 04:00:00


: I have a answering machine setup on my linux. When activated

I also have this.

: (no lock file is produced) my dialup cannot access the

Mine uses correct lock files. You have to pay attention that lock files
are located in the same directories.

Mine is vgetty + mvm.

 
 
 

1. Kill a users proccess in shell script running as root?

I have a shell script that shuts down the system. It's a single user
system. I need it first to shut down my window manager session, then
shut down the system.  In order to shut down the system I need to be
root.

Here's my problem, if I try to kill my gnome session as root, it expects
root to be running the gnome session and can't find anything to
shutdown.  If I kill the gnome session before I prompt for the root
password (and become root) in an xterm window, X will log out so the
xterm that pops up for the root password will never happen.

So as root how can I say in the script, kill this users gnome session?
Or how can I tell the script:

Shutdown X as the current user but only execute it after the user's been
prompted for the root password to shutdown the whole system.

Here's the script:

#!/bin/sh

# kill gnome session
save-session --kill; # cant put it here or it will log out of X before
pass prompt

# remove file from home directory
rm -f ~/.ICEauthority

# if user is not root prompt for password
# before shutting down else just shutdown the system
if [ "$uid" != "0" ]; then
    xterm -g 80x10+247+278 +sb -T 'Shutdown System' -e su root -c
'killall root-tail;/sbin/shutdown -h now';
else
    killall root-tail;
    /sbin/shutdown -h now;
fi

exit 0

--
####### Remove ERASE to reply #######

2. AWE64, kernel 2.1.91

3. killing netscape proccess

4. Changes to mount options in fstab ignored

5. killing a shell script is not killing child processes

6. X setup: newbie help!

7. Terminating process/script with kill -9 or kill -15

8. redirection to socket.

9. where is it explained that "kill 0" will kill the current script?

10. killing a shell script is not killing child processes

11. how to kill a program in a script that started from that script

12. KILL KILL KILL

13. Kill COREL; Kill COREL; Kill COREL; ...