{"id":3298,"date":"2021-07-11T07:06:39","date_gmt":"2021-07-10T22:06:39","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3298"},"modified":"2021-07-11T07:06:41","modified_gmt":"2021-07-10T22:06:41","slug":"output-acpid-log-to-syslog","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2021\/07\/11\/output-acpid-log-to-syslog\/","title":{"rendered":"Debian\u74b0\u5883\u3067acpid\u306e\u30ed\u30b0\u3092syslog\u306b\u51fa\u529b\u3059\u308b"},"content":{"rendered":"<div class=\"paragraph\">\n<p>ThinkPad\u306e\u96fb\u6e90\u30d7\u30e9\u30b0\u306eOn\/Off\u3067\u4ee5\u524d\u306f\u30a4\u30d9\u30f3\u30c8\u304clog\u306b\u6b8b\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\uff0c\u96fb\u6e90\u7ba1\u7406\u30c7\u30fc\u30e2\u30f3\u304c\u52d5\u3044\u3066\u3044\u3066\u96fb\u6e90\u306e\u72b6\u614b\u304c\u53d6\u5f97\u3067\u304d\u308b\u72b6\u614b\u3067\u3082\u3044\u3064\u306e\u9803\u304b\u3089\u304b\u8a18\u9332\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\uff0e\u505c\u96fb\u3057\u305f\u6642\u9593\u304c\u308f\u304b\u3063\u3066\u4fbf\u5229\u3060\u3063\u305f\u306e\u3067\u30ed\u30b0\u671f\u8a18\u9332\u3067\u304d\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><!--more--><\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>acpitool<\/code> \u3067\u96fb\u6e90\u30a2\u30c0\u30d7\u30bf\u306e\u72b6\u614b\u3092\u53d6\u5f97<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ acpitool | grep AC\n  AC adapter     : online\n$ acpitool | grep AC\n  AC adapter     : off-line<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/wiki.matoken.org\/study_meeting\/2021#%E5%B0%8F%E6%B1%9F%E6%88%B8%E3%82%89%E3%81%90_7%E6%9C%88%E3%81%AE%E3%82%AA%E3%83%95%E3%81%AA%E9%9B%86%E3%81%BE%E3%82%8A_%E7%AC%AC228%E5%9B%9E\">ThinkPad\u306eFAN\u3092\u5236\u5fa1\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u601d\u3044\u51fa\u3057\u305f<\/a>\u306e\u3067acpid\u306eman\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b\u3068\uff0c <code>-l, --logevents<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u3059\u3079\u3066\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u30ed\u30b0\u306b\u51fa\u529b\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ \/sbin\/acpid -h 2&gt;&amp;1 | grep '\\-l,'\n  -l, --logevents    Log all event activity.\n$ man acpid | grep -i logevents -A1\n       -l, --logevents\n                   This option tells acpid to log information about all events and actions.<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>\/etc\/default\/acpid<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3066\uff0cacpid \u306e\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b <code>-l<\/code> \u3092\u8ffd\u52a0\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">diff --git a\/default\/acpid b\/default\/acpid\nindex c651a78..a6a7add 100644\n--- a\/default\/acpid\n+++ b\/default\/acpid\n@@ -1,7 +1,7 @@\n # Options to pass to acpid\n #\n # OPTIONS are appended to the acpid command-line\n-#OPTIONS=\"\"\n+OPTIONS=\"-l\"\n\n # Linux kernel modules to load before starting acpid\n #<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>acpid \u3092\u518d\u8d77\u52d5\u3057\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3064\u3044\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo service acpid restart\n$ sudo service acpid status\n\u25cf acpid.service - ACPI event daemon\n     Loaded: loaded (\/lib\/systemd\/system\/acpid.service; disabled; vendor preset: enabled)\n     Active: active (running) since Sun 2021-07-11 05:57:54 JST; 44s ago\nTriggeredBy: \u25cf acpid.socket\n             \u25cf acpid.path\n       Docs: man:acpid(8)\n   Main PID: 2830732 (acpid)\n      Tasks: 1 (limit: 9336)\n     Memory: 288.0K\n        CPU: 6ms\n     CGroup: \/system.slice\/acpid.service\n             \u2514\u25002830732 \/usr\/sbin\/acpid -l\n\nJul 11 05:57:54 yoga-260 systemd[1]: Started ACPI event daemon.\nJul 11 05:57:54 yoga-260 acpid[2830732]: starting up with netlink and the input layer\nJul 11 05:57:54 yoga-260 acpid[2830732]: 1 rule loaded\nJul 11 05:57:54 yoga-260 acpid[2830732]: waiting for events: event logging is on\n$ ps aux | grep [\/]sbin\/acpid\nroot     2830732  0.0  0.0   2352   684 ?        Ss   05:57   0:00 \/usr\/sbin\/acpid -l<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>acpid \u306b <code>-l<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u3064\u3044\u3066\u3044\u308b\u72b6\u614b\u3067syslog\u3092tail\u3057\u306a\u304c\u3089\u96fb\u6e90\u3092\u629c\u304d\u5dee\u3057\u3057\u3066\u307f\u308b\u3068\u5c11\u3057\u53ef\u8aad\u6027\u304c\u60aa\u3044\u3067\u3059\u304c\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo tail -f \/var\/log\/syslog | grep acpid:\nJul 11 05:59:22 yoga-260 acpid: received netlink event \"battery PNP0C0A:00 00000080 00000001\"\nJul 11 05:59:22 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:22 yoga-260 acpid: completed netlink event \"battery PNP0C0A:00 00000080 00000001\"\nJul 11 05:59:23 yoga-260 acpid: received netlink event \"ac_adapter ACPI0003:00 00000080 00000000\"\nJul 11 05:59:23 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:23 yoga-260 acpid: completed netlink event \"ac_adapter ACPI0003:00 00000080 00000000\"\nJul 11 05:59:23 yoga-260 acpid: received netlink event \"ibm\/hotkey LEN0068:00 00000080 00006030\"\nJul 11 05:59:23 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:23 yoga-260 acpid: completed netlink event \"ibm\/hotkey LEN0068:00 00000080 00006030\"\nJul 11 05:59:23 yoga-260 acpid: received netlink event \"thermal_zone LNXTHERM:00 00000081 00000000\"\nJul 11 05:59:23 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:23 yoga-260 acpid: completed netlink event \"thermal_zone LNXTHERM:00 00000081 00000000\"\nJul 11 05:59:26 yoga-260 acpid: received netlink event \"battery PNP0C0A:00 00000080 00000001\"\nJul 11 05:59:26 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:26 yoga-260 acpid: completed netlink event \"battery PNP0C0A:00 00000080 00000001\"\nJul 11 05:59:26 yoga-260 acpid: received netlink event \"ac_adapter ACPI0003:00 00000080 00000001\"\nJul 11 05:59:26 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:26 yoga-260 acpid: completed netlink event \"ac_adapter ACPI0003:00 00000080 00000001\"\nJul 11 05:59:26 yoga-260 acpid: received netlink event \"ibm\/hotkey LEN0068:00 00000080 00006030\"\nJul 11 05:59:26 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:26 yoga-260 acpid: completed netlink event \"ibm\/hotkey LEN0068:00 00000080 00006030\"\nJul 11 05:59:26 yoga-260 acpid: received netlink event \"thermal_zone LNXTHERM:00 00000081 00000000\"\nJul 11 05:59:26 yoga-260 acpid: 0 total rules matched\nJul 11 05:59:26 yoga-260 acpid: completed netlink event \"thermal_zone LNXTHERM:00 00000081 00000000\"<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3059\u3079\u3066\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u3067\uff0c\u30dc\u30ea\u30e5\u30fc\u30e0\u3084\uff0c\u8f1d\u5ea6\u306e\u8abf\u6574\u3067\u3082\u3053\u306e\u3088\u3046\u306b\u66f8\u304d\u51fa\u3055\u308c\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">Jul 11 06:01:12 t430s acpid: received input layer event \"button\/volumeup VOLUP 00000080 00000000 K\"\nJul 11 06:01:12 t430s acpid: rule from 1840013[0:0] matched\nJul 11 06:01:12 t430s acpid: notifying client 1840013[0:0]\nJul 11 06:01:12 t430s acpid: 1 total rule matched\nJul 11 06:01:12 t430s acpid: completed input layer event \"button\/volumeup VOLUP 00000080 00000000 K\"\nJul 11 06:01:13 t430s acpid: received input layer event \"button\/volumedown VOLDN 00000080 00000000 K\"\nJul 11 06:01:13 t430s acpid: rule from 1840013[0:0] matched\nJul 11 06:01:13 t430s acpid: notifying client 1840013[0:0]\nJul 11 06:01:13 t430s acpid: 1 total rule matched\nJul 11 06:01:13 t430s acpid: completed input layer event \"button\/volumedown VOLDN 00000080 00000000 K\"\nJul 11 06:01:16 t430s acpid: received input layer event \"video\/brightnessdown BRTDN 00000087 00000000 K\"\nJul 11 06:01:16 t430s acpid: rule from 1840013[0:0] matched\nJul 11 06:01:16 t430s acpid: notifying client 1840013[0:0]\nJul 11 06:01:16 t430s acpid: 1 total rule matched\nJul 11 06:01:16 t430s acpid: completed input layer event \"video\/brightnessdown BRTDN 00000087 00000000 K\"\nJul 11 06:01:16 t430s acpid: received input layer event \"video\/brightnessup BRTUP 00000086 00000000 K\"\nJul 11 06:01:16 t430s acpid: rule from 1840013[0:0] matched\nJul 11 06:01:16 t430s acpid: notifying client 1840013[0:0]\nJul 11 06:01:16 t430s acpid: 1 total rule matched\nJul 11 06:01:16 t430s acpid: completed input layer event \"video\/brightnessup BRTUP 00000086 00000000 K\"<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u4ee5\u524d\u3088\u308a\u30ed\u30b0\u304c\u5197\u9577\u3067\u53ef\u8aad\u6027\u304c\u60aa\u3044\u3067\u3059\u304c\u3068\u308a\u3042\u3048\u305a\u52d5\u4f5c\u3057\u307e\u3057\u305f\uff0e\u3053\u308c\u3067\u505c\u96fb\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u505c\u96fb\u767a\u751f\u6642\u9593\u3084\uff0c\u77ed\u3044\u505c\u96fb\u3067\u3042\u308c\u3070\u505c\u96fb\u9593\u9694\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u58831(\u5b9f\u969b\u306fsid)<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ dpkg-query -W acpid rsyslog systemd\nacpid   1:2.0.32-1\nrsyslog 8.2102.0-2\nsystemd 247.3-5\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux 11 (bullseye)\nRelease:        11\n$ arch\nx86_64\n$ sudo lshw | grep -E '^\\ \\ \\ \\ product:|^\\ \\ \\ \\ version:'\n    product: 23533KJ (LENOVO_MT_2353)\n    version: ThinkPad T430s<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u58832<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ dpkg-query -W acpid rsyslog systemd\nacpid   1:2.0.32-1\nrsyslog 8.2102.0-2\nsystemd 247.3-5\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux 11 (bullseye)\nRelease:        11\n$ arch\nx86_64\n$ sudo lshw | grep -E '^\\ \\ \\ \\ product:|^\\ \\ \\ \\ version:'\n    product: 20FEA02WJP (LENOVO_MT_20FE_BU_Think_FM_ThinkPad Yoga 260)\n    version: ThinkPad Yoga 260<\/code><\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ThinkPad\u306e\u96fb\u6e90\u30d7\u30e9\u30b0\u306eOn\/Off\u3067\u4ee5\u524d\u306f\u30a4\u30d9\u30f3\u30c8\u304clog\u306b\u6b8b\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\uff0c\u96fb\u6e90\u7ba1\u7406\u30c7\u30fc\u30e2\u30f3\u304c\u52d5\u3044\u3066\u3044\u3066\u96fb\u6e90\u306e\u72b6\u614b\u304c\u53d6\u5f97\u3067\u304d\u308b\u72b6\u614b\u3067\u3082\u3044\u3064\u306e\u9803\u304b\u3089\u304b\u8a18\u9332\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\uff0e\u505c\u96fb\u3057\u305f\u6642\u9593\u304c\u308f\u304b\u3063\u3066\u4fbf\u5229\u3060\u3063\u305f\u306e\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[658,7,6,199,90],"tags":[617,674,675],"class_list":["post-3298","post","type-post","status-publish","format-standard","hentry","category-bullseye","category-debian-linux","category-linux","category-sid","category-testing","tag-acpi","tag-acpid","tag-syslog"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3298"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3298\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}