
ssh
월요일 아침에 나는 다음 명령을 사용하여 상자에 로그인 하고 실행했습니다.
tail -f /var/log/foo/bar.log | grep something_interesting &
나중에 어느 시점에 Ctrl+D를 눌러 로그아웃했습니다.
금요일에 동일한 상자에 로그인했는데 프로세스 tail
가 여전히 실행되고 있음을 발견했습니다. 내가 로그아웃했을 때 그 사람들이 그만뒀을 거라고 예상했어요.
더 자세히 살펴보면 해당 상자와 내가 시도한 다른 모든 Linux 상자 및 내가 시도한 하나의 Mac OS X 상자에 로 shopt huponexit
설정되어 있는 것으로 보입니다 .off
off
언제 부터 가 아닌 으로 기본값이 설정되기 시작했습니까 on
?
답변1
bash 2.02에 도입되었을 때 기본적으로 꺼진 상태였습니다.
@@ -119,6 +123,10 @@ int interactive = 0;
/* Non-zero means that the shell was started as an interactive shell. */
int interactive_shell = 0;
+/* Non-zero means to send a SIGHUP to all jobs when an interactive login
+ shell exits. */
+int hup_on_exit = 0;
+
http://git.savannah.gnu.org/cgit/bash.git/commit/shell.c?id=cce855bc5b117cb7ae70064131120687bc69fac0