{"id":225,"date":"2011-10-03T09:38:47","date_gmt":"2011-10-03T14:38:47","guid":{"rendered":"http:\/\/www.popmartian.com\/tipsntricks\/?p=225"},"modified":"2011-10-10T09:42:08","modified_gmt":"2011-10-10T14:42:08","slug":"howto-redirect-linux-console-without-reboot","status":"publish","type":"post","link":"https:\/\/www.popmartian.com\/tipsntricks\/2011\/10\/03\/howto-redirect-linux-console-without-reboot\/","title":{"rendered":"HOWTO Redirect Linux Console Without Reboot"},"content":{"rendered":"<p>You can re-apply your \/etc\/inittab file in real-time without rebooting your machine.  This allows you to do a lot of neat things, such as redirect your system console to the serial port without a reboot.<\/p>\n<ol>\n<li>Edit your \/etc\/inittab file and add this line:\n<ul>\n<li><code>S0:12345:respawn:\/sbin\/agetty -L 9600 ttyS0 vt102<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Execute the following command:\n<ul>\n<li><code>telinit q && telinit u<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Your primary console (ttyS0) should magically appear on the serial console!<\/li>\n<\/ol>\n<p>So what just happened?  The \/etc\/inittab file is read by the init system at boot.  If you added the line from step 1 and simply rebooted, you would have your console show up on the serial port right away.  We told init to re-read the <code>\/etc\/inittab<\/code> file (<code>telinit q<\/code>) and then to re-execute itself (<code>telinit u<\/code>) while preserving the init state.  Since the only change was the location of <code>ttyS0<\/code>, the console was redirected, but the system continued to run as though nothing else changed.<\/p>\n<p>The reason we used the <code>&&<\/code> method was because we may loose our console before we get a chance to execute <code>telinit u<\/code>.  This way both commands are run and init is always executed after re-reading its config.<\/p>\n<blockquote><p>Did you find this post useful or have questions or comments?  Please let  me know!<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>You can re-apply your \/etc\/inittab file in real-time without rebooting your machine. This allows you to do a lot of neat things, such as redirect your system console to the serial port without a reboot. Edit your \/etc\/inittab file and &hellip; <a href=\"https:\/\/www.popmartian.com\/tipsntricks\/2011\/10\/03\/howto-redirect-linux-console-without-reboot\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,27],"tags":[],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-how-to-do-stuff","category-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":8,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/posts\/225\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.popmartian.com\/tipsntricks\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}