{"id":6506,"date":"2024-11-26T11:45:02","date_gmt":"2024-11-26T09:45:02","guid":{"rendered":"https:\/\/skeletor.org.ua\/?p=6506"},"modified":"2024-11-26T11:45:44","modified_gmt":"2024-11-26T09:45:44","slug":"%d0%b1%d0%b5%d0%b7%d1%83%d0%bc%d0%be%d0%b2%d0%bd%d0%b8%d0%b9-reboot-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80%d0%b0","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=6506","title":{"rendered":"\u0411\u0435\u0437\u0443\u043c\u043e\u0432\u043d\u0438\u0439 reboot \u0441\u0435\u0440\u0432\u0435\u0440\u0430"},"content":{"rendered":"\n<p>\u0427\u0430\u0441 \u0432\u0456\u0434 \u0447\u0430\u0441\u0443 \u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0456\u0457, \u043a\u043e\u043b\u0438 \u043f\u0456\u0434\u0432\u0438\u0441\u0430\u0454 \u0434\u0438\u0441\u043a\u043e\u0432\u0430 \u043f\u0456\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0456 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0438\u043c\u0438 (<strong>reboot\/shutdown<\/strong>) \u0437\u0430\u0441\u043e\u0431\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u044c\u0441\u044f, \u0431\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u041e\u0421 \u043f\u043e\u0432\u0438\u043d\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 sync \u043d\u0430 \u0434\u0438\u0441\u043a\u0438, \u0430 \u0446\u044c\u043e\u0433\u043e \u0432\u043e\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435, \u0431\u043e &#8220;\u0432\u0438\u0441\u0438\u0442\u044c&#8221;. \u0426\u0435 \u043d\u0430\u0437\u0438\u0432\u0430\u0454\u0442\u044c\u0441\u044f cold reboot, \u0442\u0430\u043a \u0431\u0438 \u043c\u043e\u0432\u0438\u0442\u0438 &#8220;<strong>reboot<\/strong> \u043f\u043e \u0436\u0438\u0432\u043b\u0435\u043d\u043d\u044e&#8221;.<\/p>\n\n<p><!--more--><\/p>\n\n<h1 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#1a5dec\" class=\"has-inline-color\">IPMItools<\/mark><\/strong><\/h1>\n\n\n\n<p>\u042f\u043a\u0449\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456 \u043f\u0440\u0438\u0441\u0443\u0442\u043d\u0456\u0439 <strong>iDRAC\/IPMI\/ILO\/<\/strong>&#8230; \u0442\u043e \u043c\u043e\u0436\u043d\u0430 \u0441\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 <strong>ipmitools<\/strong>:<\/p>\n\n\n\n<p><code># ipmitool chassis powercycle<\/code><\/p>\n\n\n\n<p>\u0430\u0431\u043e, \u044f\u043a\u0449\u043e \u0446\u0435 \u0440\u043e\u0431\u0438\u0442\u0438 \u0432\u0456\u0434\u0434\u0430\u043b\u0435\u043d\u043e (\u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0439 \u0437 \u0432\u0430\u0440\u0456\u0430\u043d\u0442\u0456\u0432)<\/p>\n\n\n\n<p><code>ssh user@X.X.X.X \/usr\/bin\/sudo -S &lt;&lt;&lt; \"sudo password\" \/usr\/sbin\/ipmitool power cycle<\/code><\/p>\n\n\n\n<p><code>echo \"sudo password\" | ssh -tt user@X.X.X.X \"sudo \/usr\/sbin\/ipmitool power cycle\"<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#1a5dec\" class=\"has-inline-color\">SysRq<\/mark><\/strong><\/h1>\n\n\n\n<p>\u0426\u0435 \u043c\u0430\u0433\u0456\u0447\u043d\u0430 \u043a\u043b\u0430\u0432\u0456\u0448\u0430 \u043d\u0430 \u043a\u043b\u0430\u0432\u0456\u0430\u0442\u0443\u0440\u0456 (\u0437\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043e\u043c \u0437 \u043a\u043b\u0430\u0432\u0456\u0448\u043e\u044e <strong>print<\/strong> <strong>screen<\/strong>) \u0434\u043b\u044f <strong>low<\/strong> <strong>level<\/strong> \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f \u041e\u0421. \u0406 \u0432\u043e\u043d\u0430 \u043f\u0440\u0430\u0446\u044e\u0454 \u0442\u0456\u043b\u044c\u043a\u0438 \u043f\u0456\u0434 <strong>Linux<\/strong> (\u043c\u043e\u0436\u043b\u0438\u0432\u043e \u0456 \u043f\u0456\u0434 \u0456\u043d\u0448\u0438\u043c\u0438 \u041e\u0421, \u0430\u043b\u0435 \u043c\u0435\u043d\u0456 \u043f\u0440\u043e \u0446\u0435 \u043d\u0435\u0432\u0456\u0434\u043e\u043c\u043e). \u0417\u0430 \u0457\u0457 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u0442\u0438 \u0431\u0430\u0433\u0430\u0442\u043e \u0447\u043e\u0433\u043e. \u0429\u043e\u0431 \u0434\u0456\u0437\u043d\u0430\u0442\u0438\u0441\u044f \u0447\u0438 \u0443\u0432\u0456\u043c\u043a\u043d\u0435\u043d\u0430 \u0434\u0430\u043d\u0430 \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c, \u0442\u0440\u0435\u0431\u0430 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f <strong>\/proc\/sys\/kernel\/sysrq<\/strong>: \u044f\u043a\u0449\u043e <strong>0<\/strong> &#8211; \u0432\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e, <strong>1<\/strong> &#8211; \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e.<\/p>\n\n\n\n<p>\u0412\u043c\u0438\u043a\u0430\u0454\u043c\u043e \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c:<\/p>\n\n\n\n<p><code># echo \"1\" &gt; \/proc\/sys\/kernel\/sysrq<\/code><\/p>\n\n\n\n<p>\u041e\u0441\u044c \u0449\u043e \u043c\u043e\u0436\u043d\u0430 \u0440\u043e\u0431\u0438\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <strong>SysRq<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Function<\/th><\/tr><\/thead><tbody><tr><td><code>b<\/code><\/td><td>Will immediately reboot the system without syncing or unmounting your disks.<\/td><\/tr><tr><td><code>c<\/code><\/td><td>Will perform a system crash and a crashdump will be taken if configured.<\/td><\/tr><tr><td><code>d<\/code><\/td><td>Shows all locks that are held.<\/td><\/tr><tr><td><code>e<\/code><\/td><td>Send a SIGTERM to all processes, except for init.<\/td><\/tr><tr><td><code>f<\/code><\/td><td>Will call the oom killer to kill a memory hog process, but do not panic if nothing can be killed.<\/td><\/tr><tr><td><code>g<\/code><\/td><td>Used by kgdb (kernel debugger)<\/td><\/tr><tr><td><code>h<\/code><\/td><td>Will display help (actually any other key than those listed here will display help. but&nbsp;<code>h<\/code>&nbsp;is easy to remember \ud83d\ude42<\/td><\/tr><tr><td><code>i<\/code><\/td><td>Send a SIGKILL to all processes, except for init.<\/td><\/tr><tr><td><code>j<\/code><\/td><td>Forcibly \u201cJust thaw it\u201d &#8211; filesystems frozen by the FIFREEZE ioctl.<\/td><\/tr><tr><td><code>k<\/code><\/td><td>Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.<\/td><\/tr><tr><td><code>l<\/code><\/td><td>Shows a stack backtrace for all active CPUs.<\/td><\/tr><tr><td><code>m<\/code><\/td><td>Will dump current memory info to your console.<\/td><\/tr><tr><td><code>n<\/code><\/td><td>Used to make RT tasks nice-able<\/td><\/tr><tr><td><code>o<\/code><\/td><td>Will shut your system off (if configured and supported).<\/td><\/tr><tr><td><code>p<\/code><\/td><td>Will dump the current registers and flags to your console.<\/td><\/tr><tr><td><code>q<\/code><\/td><td>Will dump per CPU lists of all armed hrtimers (but NOT regular timer_list timers) and detailed information about all clockevent devices.<\/td><\/tr><tr><td><code>r<\/code><\/td><td>Turns off keyboard raw mode and sets it to XLATE.<\/td><\/tr><tr><td><code>s<\/code><\/td><td>Will attempt to sync all mounted filesystems.<\/td><\/tr><tr><td><code>t<\/code><\/td><td>Will dump a list of current tasks and their information to your console.<\/td><\/tr><tr><td><code>u<\/code><\/td><td>Will attempt to remount all mounted filesystems read-only.<\/td><\/tr><tr><td><code>v<\/code><\/td><td>Forcefully restores framebuffer console<\/td><\/tr><tr><td><code>v<\/code><\/td><td>Causes ETM buffer dump [ARM-specific]<\/td><\/tr><tr><td><code>w<\/code><\/td><td>Dumps tasks that are in uninterruptible (blocked) state.<\/td><\/tr><tr><td><code>x<\/code><\/td><td>Used by xmon interface on ppc\/powerpc platforms. Show global PMU Registers on sparc64. Dump all TLB entries on MIPS.<\/td><\/tr><tr><td><code>y<\/code><\/td><td>Show global CPU Registers [SPARC-64 specific]<\/td><\/tr><tr><td><code>z<\/code><\/td><td>Dump the ftrace buffer<\/td><\/tr><tr><td><code>0<\/code>&#8211;<code>9<\/code><\/td><td>Sets the console log level, controlling which kernel messages will be printed to your console. (<code>0<\/code>, for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)<\/td><\/tr><tr><td><code>R<\/code><\/td><td>Replay the kernel log messages on consoles.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u0414\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u043c\u043e\u0436\u043d\u0430 \u0430\u0431\u043e \u043d\u0430\u0442\u0438\u0441\u043d\u0443\u0442\u0438 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0443 \u043a\u043e\u043c\u0431\u0456\u043d\u0430\u0446\u0456\u044e <strong>Alt+SysRq+&lt;command_key&gt;<\/strong> \u0430\u0431\u043e <\/p>\n\n\n\n<p><code># echo &lt;command_key&gt; &gt; \/proc\/sysrq-trigger<\/code><\/p>\n\n\n\n<p>\u042f\u043a\u0449\u043e \u0442\u0440\u0435\u0431\u0430 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u0442\u043e \u0434\u043e\u0434\u0430\u0454\u043c\u043e \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u044e\u0432\u0430\u043d\u043d\u044f \u0456 \u0434\u0430\u043b\u0456 \u043a\u043b\u044e\u0447\u0456:<\/p>\n\n\n\n<p><code># echo _reisub &gt; \/proc\/sysrq-trigger<\/code><\/p>\n\n\n\n<p>\u0414\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e \u0441\u043a\u0430\u0436\u0443, \u0449\u043e \u0443 \u043a\u043e\u0436\u043d\u043e\u0457 <strong>&lt;command_key&gt;<\/strong> \u0454 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0438\u0439 \u0447\u0438\u0441\u043b\u043e\u0432\u0438\u0439 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u0437\u0456 \u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044e 2-\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0 - disable every SysRq function.\n1 - enable every SysRq function.\n2 - enable control of console logging level\n4 - enable control of keyboard (SAK, unraw)\n8 - enable debugging dumps of processes etc.\n16 - enable sync command\n32 - enable remount read-only\n64 - enable signalling of processes (term, kill, oom-kill)\n128 - allow reboot\/poweroff\n256 - allow nicing of all RT tasks<\/code><\/pre>\n\n\n\n<p>\u0456 \u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u043e\u043c\u0431\u0456\u043d\u0430\u0446\u0456\u0457 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u043e\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0454\u043c\u043e \u0441\u0443\u043c\u0443 (176=16+32+128):<\/p>\n\n\n\n<p><code># echo 176 &gt; \/proc\/sysrq-trigger<\/code><\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#1a5dec\" class=\"has-inline-color\">FreeBSD<\/mark><\/strong><\/h1>\n\n\n\n<p>\u0422\u0443\u0442, \u043d\u0430\u0436\u0430\u043b\u044c, \u043d\u0435\u043c\u0430\u0454 \u0442\u0430\u043a\u043e\u0433\u043e \u0437\u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0443 \u0456 \u0454\u0434\u0438\u043d\u0438\u0439 \u0432\u0430\u0440\u0456\u0430\u043d\u0442 &#8211; \u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438 \u043f\u0430\u043d\u0456\u043a\u0443 \u044f\u0434\u0440\u0430:<\/p>\n\n\n\n<p><code># sysctl debug.kdb.panic=1<\/code><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0430\u0441 \u0432\u0456\u0434 \u0447\u0430\u0441\u0443 \u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0456\u0457, \u043a\u043e\u043b\u0438 \u043f\u0456\u0434\u0432\u0438\u0441\u0430\u0454 \u0434\u0438\u0441\u043a\u043e\u0432\u0430 \u043f\u0456\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0456 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0438\u043c\u0438 (reboot\/shutdown) \u0437\u0430\u0441\u043e\u0431\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u044c\u0441\u044f, \u0431\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u041e\u0421 \u043f\u043e\u0432\u0438\u043d\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 sync \u043d\u0430 \u0434\u0438\u0441\u043a\u0438, \u0430 \u0446\u044c\u043e\u0433\u043e \u0432\u043e\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435, \u0431\u043e &#8220;\u0432\u0438\u0441\u0438\u0442\u044c&#8221;. \u0426\u0435 \u043d\u0430\u0437\u0438\u0432\u0430\u0454\u0442\u044c\u0441\u044f cold reboot, \u0442\u0430\u043a \u0431\u0438 \u043c\u043e\u0432\u0438\u0442\u0438 &#8220;reboot \u043f\u043e \u0436\u0438\u0432\u043b\u0435\u043d\u043d\u044e&#8221;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,26,5,10],"tags":[],"class_list":["post-6506","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-hardware","category-linux","category-others"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6506"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6506\/revisions"}],"predecessor-version":[{"id":6508,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6506\/revisions\/6508"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}