Linux Background Process ์คํํ๊ธฐ
Example
-
์ฐ๋ฆฌ๋ ์ข ์ข Background๋ก Process๋ฅผ ์คํํด์ผ ํ๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค.
- ๋ชจ๋ํฐ๋ง, ๋ฐ์ดํฐ ์ ์ก, ํฐ ํ์ผ์ ์์ถ์ ํธ๋ ๊ณผ์ .
-
์ผ๋ฐ์ ์ผ๋ก
&
์ ์ฌ์ฉํ์ฌ Process๋ฅผ Background์ ์คํํ๋๋ก ์ง์ ํฉ๋๋ค.
$ testScript.sh &
๋ฌธ์ ์
- ์ ์ํ๋ ํฐ๋ฏธ๋ ์ธ์ ์ด ๋์ด์ง๊ฒ ๋๋ฉด Background๋ก ์คํํ๋ Process๊ฐ ๊ฐ์ด ์ข ๋ฃ๋๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
How to Solve?
$ nohup testScript.sh &
Background Process ํ์ธํ๊ธฐ
$ ps -ef | grep testScript.sh
Nohup ์ข ๋ฃํ๊ธฐ
$ kill [process id]
Nohup Log
nohup.out
์ผ๋ก process ์ถ๋ ฅ๋ฌผ์ด redirect๋์ด ์ ์ฅ๋ฉ๋๋ค.