Questions tagged [sighup]
14 questions
7
votes
2 answers
Why is kill -HUP used in logrotate in RHEL? Is it necessary in all cases?
I see for syslog logging, kill -HUP is used.
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
…
GP92
- 775
- 6
- 15
- 31
6
votes
1 answer
Why do we need to send SIGHUP to a newly orphaned process group containing a stopped process?
The Advanced Programming in the UNIX Environment book ("APUE") says
Consider a process that forks a child and then terminates. Although this is nothing
abnormal (it happens all the time), what happens if the child is stopped (using …
Tim
- 98,580
- 191
- 570
- 977
3
votes
1 answer
Surprise: Interactive Bash runs commands in a separate Process Group
I am surprised that at least from Bash 4.4.19, Interactive Bash runs commands in a separate session, see following process list after I run sleep 8888:
PGID PID PPID
3150071 3150071 252603 -bash
3194323 3194323 3150071 sleep…
osexp2000
- 452
- 1
- 3
- 10
3
votes
1 answer
Is SIGHUP sent to this orphaned process, and why doesn't it terminate?
In The Linux Programming Interface:
SIGHUP is generated when a process group becomes orphaned.
In an interactive bash process,
$ ( sleep 123 &)
will first forks a subshell, and the subshell then forks to execute sleep 123 &. The subshell…
Tim
- 98,580
- 191
- 570
- 977
2
votes
1 answer
Why does huponexit not work in the following?
Bash manual says
If the huponexit shell option has been set with shopt (see Section 4.3.2 [The Shopt
Builtin], page 62), Bash sends a SIGHUP to all jobs when an interactive login shell exits.
Why does huponexit not work in the following?
In one…
Tim
- 98,580
- 191
- 570
- 977
2
votes
1 answer
Does kernel sending SIGHUP to a process group that becomes orphaned and contains a stopped process terminate all the processes by default?
In The Linux Programming Interface
To see why orphaned process groups are important, we need to view
things from the perspective of shell job control. Consider the
following scenario based on Figure 34-3:
Before the parent process exits, the…
Tim
- 98,580
- 191
- 570
- 977
2
votes
1 answer
Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?
nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork() and/or execve() on the program which follows nohup?)
Does…
Tim
- 98,580
- 191
- 570
- 977
1
vote
0 answers
xargs nano leads to Received SIGHUP or SIGTERM while xargs less is OK
Scenario:
$ cat t0.txt
t1.txt
$ cat t1.txt
xxx
$ sed -n 1p t0.txt | xargs less
# OK
$ sed -n 1p t0.txt | xargs nano
Received SIGHUP or SIGTERM
dvl-linux64 $ nano --version
GNU nano, version 2.5.3
How to open file in nano? If not xargs, then…
pmor
- 509
- 5
- 11
1
vote
0 answers
Can't create new file with nano, Received SIGHUP or SIGTERM
I found only this question of this subject: Received SIGHUP or SIGTERM: nano cannot edit empty file
I'm configuring my web server. There wasn't any problems earlier and I would like to know exactly what is causing this error? I've installed samba…
MiQuela
- 11
- 2
1
vote
1 answer
How can I stop a child process of a subshell (as per SIGSTOP) before the subshell exits?
In bash, when running ( sleep 123 &), the sleep 123 process will continue running, when the subshell exits. How can I stop the sleep 123 process before its parent subshell exits?
I'm trying to see if the sleep 123 process will be terminated, because…
Tim
- 98,580
- 191
- 570
- 977
1
vote
1 answer
Who sends SIGHUP to the controlling process of the pseudoterminal when the terminal emulator terminates?
When a terminal is disconnected, the OS kernel sends SIGHUP to the controlling process of the terminal.
When a terminal emulator terminates, who sends SIGHUP to the controlling process of the pseudoterminal underlying the terminal emulator: the OS…
Tim
- 98,580
- 191
- 570
- 977
0
votes
3 answers
Why does closing terminal emulator window terminate a bash process with SIGHUP trap changed not to terminate?
In a bash shell in a terminal emulator window of lxterminal, I run
$ trap "echo hello" SIGHUP
$ kill -s HUP $$
hello
$
and then I close the terminal emulator window.
Does closing the terminal emulator window only cause SIGHUP sent to the…
Tim
- 98,580
- 191
- 570
- 977
0
votes
0 answers
trapping HUP/SIGHUP is not working in bash script
I have this bash script:
https://gist.github.com/ORESoftware/06dbb26a48d2ddf48a5a2166834e0836
when I call ql_acquire_lock in a shell, if I can call mkdir on a directory, then I acquire that lock. When I call ql_release_lock, it removes that…
Alexander Mills
- 9,330
- 19
- 95
- 180
-2
votes
1 answer
Why doesn't the Linux kernel send SIGCONT first and then SIGHUP to a newly orphaned process group containing a stopped process?
APUE says
Since the process group is orphaned when the parent terminates, and the
process group contains a stopped process, POSIX.1 requires that every process in
the newly orphaned process group be sent the hang-up signal …
Tim
- 98,580
- 191
- 570
- 977