what happens when user does kill 1


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers what happens when user does kill 1
# 1  
Old 08-12-2008
what happens when user does kill 1

what happens when user does kill 1
and kill 0

does the system shutdown
# 2  
Old 08-12-2008
This depend on the specific OS and version. These days, almost all unix versions protect a few processes from signals. But roughly in 1987, I did a kill 1 to a very early version of HP-UX. Note that I did not use -9! init exited and the OS sent a message to the console suggesting a reboot. There was no way to restart init. I was going to reboot anyway. And on BSD 4.2 you would edit a file called /etc/ttys which was sort of a predecessor to today's inittab. To tell init to reread the file, you would do "kill -1 1". My boss got that backwards and did "kill 1 -1" and she said "the system crashed". I did not get to view the exact sequence. Back then there was no process 0. I assume that stuff like this is now safe. A few years ago I verified a claim by HP that on HP-UX, init is immune to signals... even kill -9. But I haven't gone around and tested this extensively.

You first.. Smilie
# 3  
Old 08-13-2008
I have tried it on solaris 10

kill -9 1
It says "Not Owner" even when i tried to execute it from root user.

I see the ppid of init as 0
bash-3.00# ps -ef|grep init
root 1 0 0 Jul 28 ? 7:10 /sbin/init

and when i did
kill -9 1
it shows a message "Killed"
and exits from the bash prompt
# 4  
Old 08-13-2008
You seem to be claiming two very different behaviors for "kill -9 1" on Solaris 10. Which is it? Or what was the difference between your two tests? I'm confused. Smilie
# 5  
Old 08-13-2008
sorry for the confusion

Below is the actual test and result

kill -9 1
It says "Not Owner" even when i tried to execute it from root user.

kill -9 0
it shows a message "Killed"
and exits from the bash prompt
# 6  
Old 08-13-2008
I gained some info on this the hard way back in 1999. I was working on the helpdesk and we had scripts to run as root to create new users. I was on the main DNS and NIS master for a 5000 person division of the company and the user creating script hung up. I did a "jobs" and found my script was job 1. So then I did "kill 1" forgetting that to specify a job number instead of PID you need to make it %1.

My session closed immediately and I couldn't log back in. I quickly headed toward the Unix admin's area and found one of the senior admins walking at a near run toward the server room. I hollered "Hey Dan", and without breaking stride he yelled back "WHAT DID YOU DO???"

He got it fixed fairly quickly. In the elevator on the way back down to our offices I said "Consider it a test of your slave server setup." He didn't think that was too funny. Smilie

Thus I can tell you for sure you can kill process 1 as root on Solaris 2.6 and 7 and it will crash your box. It will trigger a reboot if your auto-boot? in the OBP is set to true I believe. I'm pretty sure the protection to prevent that was included in Solaris 8, but it may have been 9.
# 7  
Old 08-13-2008
By the way, with modern versions of unix you have no way to even try to signal process 0. The kill system call uses a process of -1 and 0 to mean two collections of processes. This is documented of the kill(2) man page and it's required by posix. This change occurred roughly about the same time as versions of unix had a process 0. I'm not sure if any version of unix ever had both a process 0 and a way to signal it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kill all process of Oracle user

Hi folks, I want to kill all process of oracle user and won't kill shell, should i try this? Please confirm. 1st way pgrep -u oracle | sudo xargs kill -9 2nd way killall -u oracle (2 Replies)
Discussion started by: learnbash
2 Replies

2. AIX

How to find out and kill all processes for a user?

Hi! We are using AIX 5.3. Can anyone please guide me to find out all the running processes for a specific user, say ' admin' and also kill them by force. Thanks! atech (9 Replies)
Discussion started by: atechcorp
9 Replies

3. Shell Programming and Scripting

User idle time and kill

Hello.. I have many sleepy users on my Solaris box and need to kill them if they are idle for more than 45 minutes for example...I know who -u gives and the idle time but unable to make a awk line to get the condition perfect. Please help...:wall: (9 Replies)
Discussion started by: wimaxpole
9 Replies

4. Shell Programming and Scripting

Write a scripts to kill idle user for 60 min. & email user list to admin in text file

Folks, I have written one script for following condition by referring some of online post in this forum. Please correct it if I'm missing something in it. (OS: AIX 5.3) List the idle user. (I used whoidle command to list first 15 user and get username, idle time, pid and login time).... (4 Replies)
Discussion started by: sumit30
4 Replies

5. Shell Programming and Scripting

Kill Process not owned by other user

Hi Here is my problem: 1)I am login to unix server through my login id and do SU - xxx 2) Start the script which is running in background I want that other user which login to there id and do SU - yyy(Different user) kill that script. Could you please help me in this. (9 Replies)
Discussion started by: mr_harish80
9 Replies

6. Shell Programming and Scripting

kill all user processes

Hi there, i've been searching all over and i thought i had understood the way i should go to kill all the processes related to a user. But i'm getting more confused then i was. By lunch time i have to make a database backup, and for that all the users shoul logout. The problem is that many users... (4 Replies)
Discussion started by: vascobrito
4 Replies

7. Shell Programming and Scripting

Kill all processes belonging to one user

Hi, Is there a way to kill all processes belonging to one user in one shot? Thanks, Narayan (4 Replies)
Discussion started by: narayanv
4 Replies

8. Solaris

kill user session

how do i kill a user session (10 Replies)
Discussion started by: fsmadi
10 Replies

9. AIX

Script allows user to kill other users: I'd like to know HOW...

Hello list, Have a problem that's highlighting gaps in my knowledge; can you assist? We have a script that's tacked onto our trading application which allows branch managers etc. to kill off the sessions of other users at their branch. A menu option in the application spawns a shell running... (8 Replies)
Discussion started by: alexop
8 Replies

10. UNIX for Dummies Questions & Answers

Kill user

I have the below script to kill the user who idle for 180 minutes, it work fine , if I want to have one more checking - if the process is in "Runing" mode not in "Sleep" mode ( ps -aux |grep pid ) , then the process will not be killed ( that mean only kill the "Sleep" mode process ) could suggest... (3 Replies)
Discussion started by: ust
3 Replies
Login or Register to Ask a Question