deragon / autopoweroff

Manage automatic poweroff and other actions (suspend / custom) when specific conditions are reunited.
GNU General Public License v2.0
52 stars 7 forks source link

TypeError: sendmsg() got an unexpected keyword argument 'priority' #30

Closed it-jonas closed 2 years ago

it-jonas commented 2 years ago

Hello, on lmde 5 I run into the following error:

2022-06-10 14:37:06,723 - Autopoweroff - INFO - Startup sleep of 1 minutes.
2022-06-10 14:38:06,735 - Autopoweroff - INFO - Conditions have changed.  New conditions:
2022-06-10 14:38:06,735 - Autopoweroff - INFO -   ✓ Currently out of 'No ActionTimeRange'.
2022-06-10 14:38:06,735 - Autopoweroff - INFO -   ✘ Last event time happened over 0.0 mins, lower than configuration IdleTime parameter set to 2 mins.
2022-06-10 14:38:06,735 - Autopoweroff - INFO -   ✓ Resources are meeting conditions (CPU check disabled).
2022-06-10 14:40:06,836 - Autopoweroff - INFO - Conditions have changed.  New conditions:
2022-06-10 14:40:06,837 - Autopoweroff - INFO -   ✓ Currently out of 'No ActionTimeRange'.
2022-06-10 14:40:06,837 - Autopoweroff - INFO -   ✓ Last event time happened over 2.0 mins, greater than configuration IdleTime parameter set to 2 mins.
2022-06-10 14:40:06,837 - Autopoweroff - INFO -   ✓ Resources are meeting conditions (CPU check disabled).
2022-06-10 14:40:06,837 - Autopoweroff - ERROR - sendmsg() got an unexpected keyword argument 'priority'
2022-06-10 14:40:06,838 - Autopoweroff - ERROR - Traceback (most recent call last):
  File "/usr/sbin/autopoweroffd", line 284, in <module>
    sendmsg("All the conditions are met for running the action.",
TypeError: sendmsg() got an unexpected keyword argument 'priority'

2022-06-10 14:40:06,838 - Autopoweroff - INFO - Graceful shutdown initiated.  Please wait around 30s.
2022-06-10 14:40:15,855 - Autopoweroff - INFO - Shutdown completed.  Process PID #14200 is no more.

Seems like that the option 'priority=syslog.LOG_ALERT' isn't supported or renamed in the currently used version of debian 11. Unfortunately this exception prevents the execution of the power off/hibernation/what ever event afterwords.

deragon commented 2 years ago

Thank you! Your submission arrived a few hours to late, I corrected it yesterday with commit #69b6f3526c7bb9cfeb91e3dead21629e7fcc8e89. I need to prepare a release for this. I cannot understand how come I missed such an obvious bug (and that nobody before you detected it).

it-jonas commented 2 years ago

great seems like we worked on the bug at the same time :D