???????Linux?o??????
???????????? ???????[ 2014/3/21 10:48:45 ] ????????Linux ?????? ????
????????????????????е??????丸????????????shell???????????????????????????hangup??????????????????????hangup????????????????????????shell???????????н????????????nohup????hangup????????setsid?????????????init????(??????1)
$ echo $$
21734
$ nohup ./test.sh &
[1] 29016
$ ps -ef | grep test
515 29710 21734 0 11:47 pts/12 00:00:00 /bin/sh ./test.sh
515 29713 21734 0 11:47 pts/12 00:00:00 grep test
$ setsid ./test.sh &
[1] 409
$ ps -ef | grep test
515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
515 413 21734 0 11:49 pts/12 00:00:00 grep test
?????????????????????nohup/setsid????&????????????У?????????shell?????????????????????????е??????????????????????disown????
????$ ./test.sh &
????[1] 2539
????$ jobs -l
????[1]+ 2539 Running ./test.sh &
????$ disown -h %1
????$ ps -ef | grep test
????515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
????515 2542 21734 0 11:52 pts/12 00:00:00 grep test
????????????????????????????????subshell????У???????setsid??????????????????????????????() ???????????
????$ (./test.sh &)
????$ ps -ef | grep test
????515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh
????515 12483 21734 0 11:59 pts/12 00:00:00 grep test
??????????????黷???Red Hat Enterprise Linux AS release 4 (Nahant Update 5)??shell?/bin/bash???????OS??shell??????????Щ???????????AIX??ksh?????disown????????????nohup -p PID?????disown?????Ч????
?????????????????????????screen????????????????????????????????-r??????????????????????????????е??κ??????????nohup??Ч?????????ж???????????????????е?????????
$ screen -dmS screen_test
$ screen -list
There is a screen on:
27963.screen_test (Detached)
1 Socket in /tmp/uscreens/S-jiangfeng.
$ screen -r screen_test
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11