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 하는 역할을 무엇이란 말인가.

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

http://sluglug.ucsc.edu/pipermail/sluglug/2003-April/019313.html
여기서 답변은 time을 -t sec option으로 adjust하며 차이가 있을꺼라고 했는데 전혀 차이가 없거든요.

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

bushi의 이미지

man 에 -t 옵션에 대한 설명이 없다면 그 옵션을 사용할 수 없는 shutdown 이리라 생각합니다.
(혹시 한글페이지를 보고 절망하시는거라면 LANG=C 로 놓고 다시 불러보세요)
--help 옵션을 줘서 직접 도움말을 뱉어내도록 해보시던가요.

SysVInit 을 버리고 upstart 로 갈아탄 fedora9 이후의 shutdown 에는 그 옵션이 없습니다.
/etc/inittab 도 딸랑 한줄 뿐입니다. (id:5:initdefault:)
ctrl-alt-del 은 /etc/event.d/control-alt-delete 스크립트에 의해 처리되며,
shutdown -r now 라고 되어 있습니다.

다른 linux 배포본들에 대해서 자세히는 모르겠지만,
부팅속도를 빠르게하기 위해 전통적인 unix유산들을 많이 처분하고 재개발하고 있는 추세입니다.
있어도 쓸 일이 절대로 없는 것들은 호환성유지의 대상조차에도 포함이 안될 수 밖에 없습니다.

OTL

송효진의 이미지

아마 sleep 30 && shutdown -r now 정도의 역할을 생각하시는것 같습니다.
man shutdown 의 설명을 보니

Quote:

-t sec Tell init(8) to wait sec seconds between sending processes the warning and
the kill signal, before changing to another runlevel.

제가 제대로 이해한 것이 맞다면 init 스크립트들에게 모두 kill 신호를 주고,
정말로 죽을때 까지 기다리는 것을 -t 초간 기다리는 옵션인것 같네요.
대몬에 문제가 있어서 죽는데 오래걸리거나 안죽더라도 무시하고 전원을 내려버리는거죠.

sleep 의 역할은 옵션없이 time인자로 주면 되는걸로 보이네요.

Quote:

/sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message]

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

댓글 달기

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