{"id":1895,"date":"2014-08-13T20:47:19","date_gmt":"2014-08-14T01:47:19","guid":{"rendered":"http:\/\/protofusion.org\/wordpress\/?p=1895"},"modified":"2014-08-13T20:47:19","modified_gmt":"2014-08-14T01:47:19","slug":"beaglebone-black-soft-power-off","status":"publish","type":"post","link":"http:\/\/protofusion.org\/wordpress\/2014\/08\/beaglebone-black-soft-power-off\/","title":{"rendered":"BeagleBone Black Soft Power-Off"},"content":{"rendered":"<p><a href=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2014\/08\/beaglebone-black.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1966\" src=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2014\/08\/beaglebone-black-600x400.jpg\" alt=\"BeagleBone Black\" width=\"550\" height=\"366\" srcset=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2014\/08\/beaglebone-black-600x400.jpg 600w, http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2014\/08\/beaglebone-black-300x200.jpg 300w, http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2014\/08\/beaglebone-black.jpg 1200w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<p>The BeagleBone Black is an ARM-based device and doesn&#8217;t have ACPI support like most x86 systems. ACPI generally handles triggering shutdown and other power management events on x86 systems, so this functionality is missing on the BeagleBone. We can easily work around this problem with <em>acpid<\/em>, which provides an event handling script that is triggered when the power button is pressed. This is a simple way to add power button triggered shutdown without actually having ACPI support in the hardware.<\/p>\n<p><!--more--><\/p>\n<p>First, install <em>acpid<\/em> from your distribution&#8217;s package manager. For Arch Linux ARM:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo pacman -S acpid<\/pre>\n<p>Next, open \/etc\/acpi\/handler.sh in a text editor. Look for the snippet containing &#8220;PowerButton pressed&#8221; near the beginning of the script. After this line, add a new line with &#8220;poweroff&#8221; on it. You may also add any other commands you wish to run when the power button is pressed.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n        case &quot;$2&quot; in\r\n            PBTN|PWRF)\r\n                logger 'PowerButton pressed'\r\n                poweroff\r\n                ;;\r\n            *)\r\n                logger &quot;ACPI action undefined: $2&quot;\r\n                ;;\r\n        esac\r\n        ;;\r\n<\/pre>\n<p>Now enable and start the <em>acpid<\/em> daemon. On <em>systemd<\/em>-based distros, use the method below.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable acpid.service\r\nsystemctl start acpid.service\r\n<\/pre>\n<p>Now that <em>acpid<\/em> is running, power button events will be handled by the events script. Note that the <em>acpid<\/em> service will generate errors in its log because it is unable to communicate with the kernel, but the poweroff will execute as expected.<\/p>\n<p>Finally, press the power button on your BeagleBone and it should begin shutting down. If you encounter any issues, check the logs of the <em>acpid<\/em> service to make sure it launched properly. Also double-check your syntax in the event handler script.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The BeagleBone Black is an ARM-based device and doesn&#8217;t have ACPI support like most x86 systems. ACPI generally handles triggering shutdown and other power management events on x86 systems, so this functionality is missing on the BeagleBone. We can easily<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"http:\/\/protofusion.org\/wordpress\/2014\/08\/beaglebone-black-soft-power-off\/\">Read more &#8250;<\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[218,189,217,250],"class_list":["post-1895","post","type-post","status-publish","format-standard","hentry","category-linux","tag-acpid","tag-arch-linux-arm","tag-beaglebone","tag-linux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pNjAs-uz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/comments?post=1895"}],"version-history":[{"count":15,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1895\/revisions"}],"predecessor-version":[{"id":1970,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1895\/revisions\/1970"}],"wp:attachment":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/media?parent=1895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/categories?post=1895"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/tags?post=1895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}