shutdown -t 가 정말로 하는 역할이 뭡니까?

이종진의 이미지

shutdown 관련 man page 역시 여러번 읽어 봤지만 하나도 도움이 안되는 군요.
과연 man을 읽고서 결정적 도움을 받은적이 몇번이 있던가 하는 생각도 듭니다.
문제는 shutdown 할때 보통 shutdown -r now 하든가 shutdown -h now하던가 분단위로 시간을 입력하여 shutdown -h +10 "bye"하면 bye를 warning message로 하여 우선 바로 warning message를 보여주고 10분뒤에 다시 warning message를 보여주면서 halt하죠..

근데 inittab에 보면 ctrlaltdel할때 보통 다음과 같은 명령을 쓰는데
shutdown -t3 -r now
여기서 문득 -t3이 뭘까 궁굼해졌습니다.

우선 man을 봤죠.
man에서 말하길 warning message와 kill signal 간의 초단위 delay 랍니다.
그래서 저는 time을 그냥 쓰면 분단위고 -t를 함께 쓰면 초단위인가? 라고 생각했답니다.
그리고 뒤 이어서, 그렇다면의 위의 명령에서 now는 왜 썼을 까? 3초 delay가 있는데 now라는 time delay를 왜 이중을 적었을까 하는 생각이 들었죠.

그래서 우선 다음같이 해 봤죠.
shutdown -t30 -r
time parameter가 없다고 안됩니다.

shutdown -t 30 -r
역시
time parameter가 없다고 안됩니다.

그래서
shutdown -t30 -r now
또는
shutdown -t 30 -r now

그랬더니 30초를 기다리기는 커녕 바로 reboot하더군요.

그렇다면 도대체 -t 하는 역할을 무엇이란 말인가.

인터넷을 뒤져봤는데 누군가 저랑 똑같은 걸 궁굼해 했는데
제대로 답변이 없더군요.

알려주시면 감사하겠습니다.

익명 사용자의 이미지

-t 뒤에 띄어 써야됩니다.

익명 사용자의 이미지

$ man shutdown
SYNOPSIS
  /sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message]
  -t sec Tell init(8) to wait sec seconds between sending processes the warning and the kill signal, before changing to another runlevel.
  time   When to shutdown.  

30분 뒤에 shutdown 하고 싶으면 shutdown +30
10시 10분에 shutdown 하고 싶으면 shutdown 10:10
-t는 프로세스에 warning 신호를 주고, 실제로 kill할때까지 기다리는 시간이라는 거 같습니다.
근데 왜 실제로 즉시 종료하는지는 다른분께서..ㅎㅎ
(기다릴 필요가 없어서 안기다리는거겠지요?)

익명 사용자의 이미지

아.. 제가 질문을 뛰엄뛰엄봤네요..

막상 궁금해하신게 "왜 30초를 기다리지 않는가"였네요..

일단 time argument는 반드시 줘야합니다.

NOTES
       A lot of users forget to give the time argument and are then puzzled by the error message shutdown produces. 
       The time argument is mandatory; in 90 percent of all cases this argument will be the word now.

-t 30에 대해서 왜 정확히 30초를 기다리지 않는가에 대한대답은
1. 이미 모든 프로세스가 실제로 종료되었기때문이거나,
2. now라는 시간 argument가 주어지면 안기다리는다는 rule이 있거나..

1번일것 같습니다만,
2번일지도 모르는 이유는 역시 man 페이지를 보면

      -c     Cancel a waiting shutdown. ("shutdown now" is no longer waiting.) With this option it is of course not possible to give the time  argument,
              but you can enter explanatory message arguments on the command line that will be sent to all users.

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.