3
votes
3answers
45 views

New parent process when the parent process dies

In UNIX, when a parent process disappears, I thought that all child processes reset init as their parent. Is this not correct all the time? Are there any exceptions?
1
vote
3answers
84 views

How do I shutdown the system after a particular process exits

I am downloading some software; I can see the pid of the download process with top. Let's say it's 1001. How can I make it so that my computer shuts down after process 1001 exits?
69
votes
4answers
1k views

Can I somehow add a “&& prog2” to an already running prog1?

Most shells provide functions like && and ; to chain the execution of commands in certain ways. But what if a command is already running, can I still somehow add another command to be executed ...
3
votes
1answer
468 views

wait does not wait

If i have a file called myprogram containing sleep 200 date Run this in the background: $ sh myprogram & i want to know when myprogram has completed by using wait command $ cat >notify ...
1
vote
2answers
1k views

How to pass data outside process for zenity progress?

Usually this would be a question about how to pass data from a subprocess to a main process, but maybe zenity has some extra quirks so please focus on zenity. Example: #!/bin/sh ( echo "10" ; sleep ...
4
votes
1answer
98 views

Is it the process that cleans itself on termination or the kernel?

Recently I found this in a powerpoint presentation: When a program is compiled and linked, the linker inserts some extra code in the program. It is this code that calls the main function about the ...
2
votes
3answers
783 views

What is meant with terminating a process normally?

In an examination it is stated: Give 2 different ways that a process can terminate normally. Describe the differences. What is meant with terminate normally?
5
votes
1answer
272 views

Return value of a process and comparison of the number

I have a val.py python script that returns a negative number. import sys sys.exit(-1234) When I run this bash script, I get the value $? as return value of 46 (not -1234). Even when I tried to ...
2
votes
2answers
756 views

Removing zombie process from the process table

Can somebody please explain when parent process receives the exit status of a dead child process via wait, who actually reallocates the memory of the child process and removes it from the process ...