Re: HUP doesn't send to processes when logout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/29/2008 10:05 AM, 平天韩 wrote:
hi,

It seems that when I logout from the console, the background process
doesn't get HUP signal:
{ trap "echo Ignore HUP >>/tmp/trap.out" 1; while sleep 3;do echo
hello >>/tmp/hello.txt;done; }&
And it seems it will become a daemon and run forever until rebooting.
Is this correct? Why it didn't get HUP signal?

Thanks!

Are you running this from a terminal window?
Are you possibly setting nohup in your environment.
Are you typing the above commands directly? What happens if you place these into a script and run the script in the background?

There are a number of things that can cause a shell script to ignore the HUP signal. I tested this as a script on an Ubuntu laptop, and it behaved the same as yours:

The process remained. So the issue is not that exiting the parent process (GNOME Term) or logging out of GNOME fails to issue a HUP, it is that the process itself ignores the HUP signal since I sent a "kill -HUP <pid>" to the process.

If you simply send the HUP signal, you will see that "Ignore HUP" will appear in /tmp/trap.out".

The signal(1) command is probably the culprit, though the man pages are vague.

--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux