且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么时候停止HUP得到发送,我能做些什么呢?

更新时间:2023-11-05 16:55:04

我相信你正在寻找的 huponexit shell选项。您可以轻松地设置此

I believe you're looking for the huponexit shell option. You can set this easily with

$ shopt -s huponexit

从bash的手册页的一些细节:

Some details from the bash man page:

通过在收到SIGHUP默认的shell退出。之前
  退出,交互的shell重新发送SIGHUP所有作业,运行
  要么
         停止。已停止作业发送SIGCONT以确保他们收到SIGHUP。以prevent从信号发送到外壳
  一杆
         满足特殊的工作,应该从与不认内置的作业表中删除(见SHELL BUILTIN以下命令)或标注不
  接收
         使用SIGHUP不认-h。

The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped. Stopped jobs are sent SIGCONT to ensure that they receive the SIGHUP. To prevent the shell from sending the signal to a par- ticular job, it should be removed from the jobs table with the disown builtin (see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP using disown -h.

如果该huponexit外壳选项设置禁用了javascript带,庆典发送SIGHUP所有作业当一个交互式登录shell退出。

If the huponexit shell option has been set with shopt, bash sends a SIGHUP to all jobs when an interactive login shell exits.