nohup사용시 nohup.out

jungwook의 이미지


터미널이 종료되어도 계속 실행되는 nohup을 사용하고 있습니다.

그런데 프로그램 실행되고 나면 표준 출력이 nohup.out으로 기록이 되는데
이것을 파일이 아닌 표준 출력(모니터)로 하고 싶습니다.

nohup application& 이렇게 실행중이고

원하는 파일로 로그를 남기는 것은

nohup applilcation > file.log

그리고 궁금한 건 nohup으로 실행한다고 해도 백그라운드로 자동적으로 수행되는 것은 아니네요??
$>nohup application
nohup: ignoring input and appending output to `nohup.out'
(공백)

이런 출력이 나오고 이때 control + c를 누르면 프로세스가 죽네요. top으로 확인해보니..

그래서 아래 방식으로 실행해보니

$>nohup application&

[4] 13559
cho@ecedb:~/benchmark$ nohup: ignoring input and appending output to `nohup.out'

여기서 엔터치고 top으로 확인하면 프로세스가 동작하고 있네요.

일단 다시 질문을 정리하면 nohup을 사용하고 백그라운드로 동작하는 프로세스의 출력을 파일이 아닌 스크린으로 하고 싶습니다.

p.s 그리고 리눅스에서 백그라운드로 동작된다는 것은 어떤 점이 달라지는거죠? 스케쥴링이 달라지는 건가요??

보통 application 수행중에 control+z을 눌리면

Stopped 이렇게 나오고
그후 bg를 입력해도 백그라운드로 실행되는거 같던데~ 궁금하네요.

그럼 미리 감사드립니다.

jungwook의 이미지

서버에서 백그라운드 & 수행시 터미널이 종료되면 프로세스가 죽어서 검색을 해보니

shopt -s huponexit 로 이 부분을 설정하면 된다고 나오는데, 접속할 때마다 다시 huponexit가 off로 되어있네요.
그래서 그런지 백그라운 실행 후 터미널을 종료하고 다시 서버에 접속해서 top을 해보면 프로세스가 죽어있습니다.

제가 잘못 알고 있는건가요?? ㅡㅡ;

송효진의 이미지

screen 을 이용해 보시면 좋을것 같네요.

$ screen
 
new$ ./application
 
ctrl a d
[detached]
$ screen -r
new$ ./application

emerge money
http://wiki.kldp.org/wiki.php/GentooInstallSimple - 명령어도 몇 개 안돼요~
http://xenosi.de/

eerien의 이미지

$ nohup (command) &
$ tail -f nohup.out

:+:eerie+Nightfall:+:

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.