You are not logged in.

#1 2017-11-10 14:36:29

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Possible Bug: Laptop low battery, cannot shutdown when screen locked.

Issue:
By default bunsenlabs requires a password to login and when the computer sits idle for a period of time the screen locks and requires login.
When left unattended, my laptop battery gets low, and the computer cannot auto shutdown because bunsenlabs prompts for a su password to shutdown while the screen is locked.
Thus the battery drains all the way to zero. I actually fried a laptop battery due to this issue and had to order a new battery. (evidently laptop batteries can only drain to zero so many times) This happened several times to me before I realized what was going on, I figured out what was happening because the last time I caught it right at 1%, and saw that a messagebox was prompting for a su password to perform the shutdown.
Does anyone know how to fix this issue? I did some googling but could not find anything.
Thanks in advance!

Offline

#2 2017-11-10 14:48:50

Steve
Member
Registered: 2017-01-03
Posts: 606

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

I think bunsenlabs uses xfce4-power-manager

So what do your setting look like when you invoke the below command?

xfce4-power-manager-settings

It is up to you to take control of how your computer is powered not bunsenlabs.

Offline

#3 2017-11-10 20:31:41

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

Hi Steve,
I don't think you understand what I was saying.
The settings in "xfce4-power-manager-settings" are set correctly to shutdown my computer at 10% battery life. Problem is when the screen is locked and the battery drains below 10% the automatic shutdown does not work, because a SUDO prompt pops up (Behind the lock screen, you can't see it) and the computer does not shutdown.

Offline

#4 2017-11-10 23:00:44

Steve
Member
Registered: 2017-01-03
Posts: 606

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

my bad sorry.

sounds like an authorisation problem with xfce4 power settings.

in a terminal what does

xfce4-power-manager --dump

output ?

Last edited by Steve (2017-11-10 23:01:20)

Offline

#5 2017-11-10 23:16:58

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

12oclocker wrote:

Does anyone know how to fix this issue?

Try https://forums.bunsenlabs.org/viewtopic … 171#p62171 but add a second stanza that allows any user to shutdown (ie, replace suspend with shutdown).

Or disable the screen locker by following this guide:

https://forums.bunsenlabs.org/viewtopic.php?id=2080


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#6 2017-11-11 13:23:28

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

I am not allowed to disable screen lock (company policy) I use this computer at work and do coding on it. I will take a look at the link you posted as well...
Also here is my output from the dump requested, thank you both...
---------------------------------------------------
       Xfce power manager version 1.4.4
With policykit support
With network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorized to suspend: True
Authorized to hibernate: True
Authorized to shutdown: True
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has LID: True

Offline

#7 2017-11-11 13:36:22

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

I created file "inactive-suspend.pkla" in "/etc/polkit-1/localauthority/10-vendor.d/"
But I am not sure what the file permissions should be?  is "-rw-r--r--" ok?
I don't see any info on that in the post...
I created the file as super user (had to, did not have permission as a regular user)
I pasted the below info into the file...
If you can let me know what you think is the correct permissions for the file, I will test this and report back if it solves the issue, thank you again!

[Allow inactive users to suspend]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultInactive=yes
ResultActive=yes

Offline

#8 2017-11-11 13:55:03

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

You don't have to worry about permissions, just use this command to create the file and save it when you're finished:

sudoedit /etc/polkit-1/localauthority/10-vendor.d/inactive-suspend.pkla

"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#9 2017-11-12 02:45:59

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,409
Website

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

12oclocker wrote:

I pasted the below info into the file...
...
[Allow inactive users to suspend]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultInactive=yes
ResultActive=yes

Don't forget shutdown!

Head_on_a_Stick wrote:

add a second stanza that allows any user to shutdown (ie, replace suspend with shutdown).

EDIT: In fact the Action you want is not shutdown but power-off. IE the Action line should be

Action=org.freedesktop.login1.power-off

This is still untested though.

Last edited by johnraff (2017-11-12 03:02:01)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#10 2017-11-13 17:32:03

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

thanks, I have added the "power-off" action as well.
I will see how it goes this week, I always end up leaving the laptop unattended, we will find out if it shuts down properly ;-)  Thanks for you help everyone, I will report back with results.

Offline

#11 2017-12-06 02:34:55

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,409
Website

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

@12oclocker did that power-off setting fix your issue?
If so, we might consider adding it to the default BunsenLabs configs.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#12 2017-12-06 21:12:22

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

Hi John,
I tested it today and it works.
Please go ahead and add it to the default BunsenLabs configs.
Thanks!

Offline

#13 2017-12-07 02:14:00

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,409
Website

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

^Thanks for the feedback. smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#14 2017-12-07 02:28:44

12oclocker
Member
Registered: 2016-01-18
Posts: 17

Re: Possible Bug: Laptop low battery, cannot shutdown when screen locked.

Your welcome, thanks for the help everyone ;-)

Offline

Board footer

Powered by FluxBB