{"id":7573,"date":"2016-02-20T22:49:08","date_gmt":"2016-02-21T03:49:08","guid":{"rendered":"https:\/\/spinor.info\/weblog\/?p=7573"},"modified":"2016-02-20T22:49:08","modified_gmt":"2016-02-21T03:49:08","slug":"kill-pid-1","status":"publish","type":"post","link":"https:\/\/spinor.info\/weblog\/?p=7573","title":{"rendered":"kill [pid] -1"},"content":{"rendered":"<p>OK,\u00a0my Linux friends&#8230; try not to make the mistake that I made earlier tonight.<\/p>\n<p>I was trying to stop a process in the gentlest way possible, buy sending it a hangup signal to its numerical process ID, e.g., 12345. The syntax was supposed to be this:<\/p>\n<p><tt>kill -1\u00a012345<\/tt><\/p>\n<p>Unfortunately this is not what I typed. Because it was an afterthought that I&#8217;d use a hangup signal (instead of the default kill signal) I entered the option after the process ID, like this:<\/p>\n<p><tt>kill 12345 -1<\/tt><\/p>\n<p>A second or two later, I lost my <tt>xterm<\/tt> session. In fact, I lost all my <tt>xterm<\/tt> sessions. My mail client disconnected. I could not even <tt>telnet<\/tt> into the server anymore. For all practical intents and purposes, it seemed dead as a doorknob.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7574\" src=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1.jpg\" alt=\"\" width=\"400\" height=\"400\" srcset=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1.jpg 400w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-150x150.jpg 150w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-300x300.jpg 300w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-96x96.jpg 96w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-24x24.jpg 24w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-36x36.jpg 36w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-48x48.jpg 48w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2016\/02\/kill-9-1-64x64.jpg 64w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>OK, not completely dead. I was able to log back in through its physical keyboard, only to find out that apart from core processes, nothing was running. No SQL server. No Web server. No SSH demon. No name server. And so on.<\/p>\n<p>What the !#@@#@!&amp; have I done?<\/p>\n<p>I looked at the command long and saw the last command that I typed. I quickly checked the <tt>man<\/tt> page of <tt>kill<\/tt> and indeed&#8230; what I typed instructed <tt>kill<\/tt> to terminate process 12345 (using the default\u00a0kill signal) and then, using the same default kill signal, <em>terminate all processes with a pid greater than 1<\/em>.<\/p>\n<p>Bravo. What a clever boy. I promise I&#8217;ll try not to do that again anytime soon.<\/p>\n<p>Still, I was able to bring everything back to life without rebooting the server. I hate reboots.<\/p>\n<fb:like href='https:\/\/spinor.info\/weblog\/?p=7573' send='true' layout='standard' show_faces='true' width='450' height='65' action='like' colorscheme='light' font='lucida grande'><\/fb:like>","protected":false},"excerpt":{"rendered":"<p>OK,\u00a0my Linux friends&#8230; try not to make the mistake that I made earlier tonight. I was trying to stop a process in the gentlest way possible, buy sending it a hangup signal to its numerical process ID, e.g., 12345. The syntax was supposed to be this: kill -1\u00a012345 Unfortunately this is not what I typed. <a href='https:\/\/spinor.info\/weblog\/?p=7573' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-7573","post","type-post","status-publish","format-standard","hentry","category-computers","category-11-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/7573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7573"}],"version-history":[{"count":7,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/7573\/revisions"}],"predecessor-version":[{"id":7581,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/7573\/revisions\/7581"}],"wp:attachment":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}