Some interesting questions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Some interesting questions
# 1  
Old 03-02-2005
Some interesting questions

Hello All,

I have some questions;

1) process1 | process2,

A)now if I kill process2 what happens to process1?
B) if I kill process1 what happens to process2?

2) Why kill -9 is a strong kill? If possible I would like to know what happens internally.

3) What a pipe actually do, in terms of file descriptor?

Any help, any links is appreciated.

Thank you
# 2  
Old 03-02-2005
You might want to look at the rules and note number 6.

Then post what these questions have to do in real life situation you are facing.
# 3  
Old 03-02-2005
RTM,

Thank you for your reply. I am aware of the fact that "No homework/classwork questions". I am writing some IPC code, and I am facing some difficulties. For example, for my 1st question , i am confused about, when I kill process2, process1 remains there, and when I kill process1, process2 remains there 9isnt this weird??), and thats why i posted the question in a simple manner. Also for rest of th questions, same thing, I know that, stromg kill is called as strong coz, it cannot be caught by the process, and in turn process gets terminated, but I wanted to find what actually happens "internally".

I hope i have cleared that those are not homework/classwork questions.

Thank you
# 4  
Old 03-02-2005
For some of this, it's not clear what you want. For many signals, the default action is to terminate the process. This means the kernel kills it pretty much as if the process had called exit(). Some signals can be "caught". This means that a function runs instead. Well behaved processes catch signals and clean up temp files, release resources, etc. But a process cannot catch 9. 9 will instantly kill a process (if it's killable).

A pipe, you write data on one side and read the data from the other side. What else do you want here?

process1 | process2
Kill either process and nothing at all happens to the other process. However the pipe is broken. If process1 dies, the next time that process2 tries a read from the pipe, it will get eof. Many programs will decide to exit at this point. If process2 dies, process1 will get a SIGPIPE on the next write. The default action for SIGPIPE is exit. But a program can catch or ignore the signal. Both mechanisms depend on data flowing across the pipe.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

2. Solaris

Very Interesting Problem

Ok Lets say i have a webpage on a solaris box. and i am trying to make a hyperlink. This hyperlink references a Microsoft Access file on a Windows box. So, How do i make a file reference from The unix box to a windows box. Things to keep in mind -- 1.) Solaris doesnt need to... (6 Replies)
Discussion started by: Demon002
6 Replies

3. Shell Programming and Scripting

interesting problem

Hi, I am new in this forum and I am glad to be a part of it. I have a problem that has two parts: 1/ extract just the timestamp from a filename: for example, I have a file called 'sales20080226144525.txt' and I want to extract just the '20080226144525' part out of it. 2/ Now, take that... (5 Replies)
Discussion started by: ChicagoBlues
5 Replies

4. Shell Programming and Scripting

Here is an interesting idea...

Does anyone know how to test if an ethernet interface is alive, or accepting connections? Here is the scenario - I have rsc and sc console interfaces on some Suns. There are some sporadic vulnerability scans that send them out to lunch when they run the scans. I have to login to the host and reset... (0 Replies)
Discussion started by: lm_admin_dh
0 Replies

5. What is on Your Mind?

How can I get some interesting books?

I am not a native English speaker. I wanna improve my English. But I am kind of lazy, so I decide to pratice my English by reading English novel. I'd like read books about magic or superman and so on. How can I get that kind of books from Internet? I'll really appreciate it!! (4 Replies)
Discussion started by: virmin
4 Replies

6. UNIX for Advanced & Expert Users

interesting problem

After a server reboot for regular mainatanance we face the following situation: 1/ user accounts with ksh can't start the korn shell 2/ korn shell scripts do work however, if executed from bash 3/ normal users with bash can't run ksh 4/ root can run ksh 5/ if I switch the default shell to... (3 Replies)
Discussion started by: rein
3 Replies

7. UNIX for Advanced & Expert Users

An interesting problem

hi!, here is an interesting problem ..... I ftp a file named " my first file.doc" from windows to my HP workstation. Ftp is succesful. The file appears with the same name in my home directory.. But now how do I open this file?? while using Vi or More or other editor, they take only the... (5 Replies)
Discussion started by: jyotipg
5 Replies
Login or Register to Ask a Question