Disable shutdown on low battery  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Disable shutdown on low battery

#1 Post by mxismythang »

I have two batteries, both genuine HP products. One works perfectly, but is swelling up, and the other last for hours, but reports bad values. I opted to go for the bad values rather than swelling my laptop apart. The battery with the bad chip info reports 0% when it has hours of life left, so naturally, the only way to use this battery is to disable auto-shutdown, which I have done in the xfce4 power manager (On Critical Battery Power: Do Nothing) on both battery and on A/C.

However, I still receive a notification to make a decision with three options (IIRC: Hiberbate, Sleep, Shutdown) and a cancel button. I cancel, and continue working, but within a few more seconds to a minute, the OS performs an unexpected shutdown.

How can I prevent this unwanted shutdown that must be triggered from elsewhere?

I live in Central America, and getting replacements is not easy, and other than misreporting to the OS, this battery works fine. I usually am on line power, but we lose power often here, and it is a laptop, so I'd like to use it on battery sometimes.

TIA :hug:

Code: Select all

$ upower -i $(upower -e | grep -i BAT0)
  native-path:          BAT0
  vendor:               Hewlett-Packard
  model:                Primary
  serial:               48018 2015/05/09
  power supply:         yes
  updated:              Thu 30 Nov 2023 12:26:29 PM CST (42 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              0.2166 Wh
    energy-empty:        0 Wh
    energy-full:         0.2166 Wh
    energy-full-design:  0.2166 Wh
    energy-rate:         0 W
    voltage:             12.864 V
    percentage:          100%
    capacity:            100%
    technology:          lithium-ion
    icon-name:          'battery-full-charged-symbolic'

Code: Select all

System:    Kernel: 5.10.0-26-amd64 [5.10.197-1] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/vmlinuz-5.10.0-26-amd64 root=UUID=<filter> ro quiet 
           init=/lib/systemd/systemd 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_x64 Wildflower January 15  2023 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: Hewlett-Packard product: HP EliteBook 840 G2 v: A3008D510B03 
           serial: <filter> Chassis: type: 10 serial: <filter> 
           Mobo: Hewlett-Packard model: 2216 v: KBC Version 96.5B serial: <filter> 
           BIOS: Hewlett-Packard v: M71 Ver. 01.31 date: 02/24/2020 
Battery:   ID-1: BAT0 charge: 0% condition: 0.2/0.2 Wh (100.0%) volts: 11.2 min: 11.4 
           model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: Charging 
CPU:       Info: Dual Core model: Intel Core i5-5300U bits: 64 type: MT MCP arch: Broadwell 
           family: 6 model-id: 3D (61) stepping: 4 microcode: 2F cache: L2: 3 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 18357 
           Speed: 2694 MHz min/max: 500/2900 MHz Core speeds (MHz): 1: 2694 2: 2694 3: 2694 
           4: 2694 
           Vulnerabilities: Type: gather_data_sampling status: Not affected 
           Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data status: Unknown: No mitigations 
           Type: retbleed status: Not affected 
           Type: spec_rstack_overflow status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: 
           conditional, RSB filling, PBRSB-eIBRS: Not affected 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable 
Graphics:  Device-1: Intel HD Graphics 5500 
           vendor: Hewlett-Packard ZBook 15u G2 Mobile Workstation driver: i915 v: kernel 
           bus-ID: 00:02.0 chip-ID: 8086:1616 class-ID: 0300 
           Device-2: Chicony HP HD Webcam type: USB driver: uvcvideo bus-ID: 2-7:5 
           chip-ID: 04f2:b477 class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.18.0 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
           s-diag: 414mm (16.3") 
           Monitor-1: eDP-1 res: 1366x768 hz: 60 dpi: 112 size: 309x174mm (12.2x6.9") 
           diag: 355mm (14") 
           OpenGL: renderer: Mesa Intel HD Graphics 5500 (BDW GT2) v: 4.6 Mesa 20.3.5 
           direct render: Yes 
Audio:     Device-1: Intel Broadwell-U Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel bus-ID: 00:03.0 chip-ID: 8086:160c class-ID: 0403 
           Device-2: Intel Wildcat Point-LP High Definition Audio vendor: Hewlett-Packard 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:9ca0 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-26-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I218-LM vendor: Hewlett-Packard driver: e1000e v: kernel 
           port: 3080 bus-ID: 00:19.0 chip-ID: 8086:15a2 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel modules: wl port: ef80 
           bus-ID: 02:00.0 chip-ID: 8086:095a class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 
           bus-ID: 2-4:4 chip-ID: 8087:0a2a class-ID: e001 
           Report: hciconfig ID: hci0 rfk-id: 1 state: down bt-service: enabled,running rfk-block: 
           hardware: no software: yes address: <filter> 
           Info: acl-mtu: 1021:5 sco-mtu: 96:6 link-policy: rswitch hold sniff 
           link-mode: slave accept 
Drives:    Local Storage: total: 238.47 GiB used: 140.35 GiB (58.9%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Micron model: MTFDDAK256TBN-1AR1ZABHA 
           size: 238.47 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: SSD 
           serial: <filter> rev: 0012 scheme: MBR 
Partition: ID-1: / raw-size: 237.46 GiB size: 232.67 GiB (97.98%) used: 140.25 GiB (60.3%) 
           fs: ext4 dev: /dev/dm-0 maj-min: 253:0 mapped: root.fsm 
           ID-2: /boot raw-size: 1024 MiB size: 973.4 MiB (95.06%) used: 105.1 MiB (10.8%) 
           fs: ext4 dev: /dev/sda1 maj-min: 8:1 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 54.0 C mobo: 0.0 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: 2274 note: see --pkg apt: 2238 lib: 1125 flatpak: 36 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bullseye main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://atl.mirrors.clouvider.net/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list 
           1: deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main
           No active apt repos in: /etc/apt/sources.list.d/librewolf.list 
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mirrors.rit.edu/mxlinux/mx-packages/mx/repo/ bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/nordvpn.list 
           1: deb https://repo.nordvpn.com/deb/nordvpn/debian stable main
           Active apt repos in: /etc/apt/sources.list.d/signal-xenial-added-by-mxpi.list 
           1: deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
Info:      Processes: 230 Uptime: 0m wakeups: 7 Memory: 15.04 GiB used: 2.21 GiB (14.7%) 
           Init: systemd v: 247 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: N/A alt: 10 
           Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: BIOS (legacy, CSM, MBR)
Last edited by mxismythang on Thu Nov 30, 2023 3:28 pm, edited 1 time in total.

User avatar
Eadwine Rose
Administrator
Posts: 15251
Joined: Wed Jul 12, 2006 2:10 am

Re: Disable shutdown on low battery

#2 Post by Eadwine Rose »

Please share the full QSI.
MX-23.6_x64 July 31 2023 * 6.1.0-39amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Disable shutdown on low battery

#3 Post by l0dr3 »

BOTH of yo batteries (according to the description you gave) are DEGRADED and DANGEROUS :exclamation: :exclamation: :exclamation:

PLZ - do not use them any longer (as far as you manage to get replacements ... ), REMOVE them and drive this system w#AC-POWER-ONLY :crossfingers:

A serious warning, in mind of an incident (aka 'accident' - a total burn-down of a laptop w#such degradated batteries, short before a total 'Burn-Down' of my homelab :exclamation: ), that happened to me ~ 5years ago,

greetz, l0dr3

User avatar
j2mcgreg
Global Moderator
Posts: 7200
Joined: Tue Oct 23, 2007 12:04 pm

Re: Disable shutdown on low battery

#4 Post by j2mcgreg »

l0dr3 wrote: Thu Nov 30, 2023 2:31 pm BOTH of yo batteries (according to the description you gave) are DEGRADED and DANGEROUS :exclamation: :exclamation: :exclamation:

PLZ - do not use them any longer (as far as you manage to get replacements ... ), REMOVE them and drive this system w#AC-POWER-ONLY :crossfingers:

A serious warning, in mind of an incident (aka 'accident' - a total burn-down of a laptop w#such degradated batteries, short before a total 'Burn-Down' of my homelab :exclamation: ), that happened to me ~ 5years ago,

greetz, l0dr3
I agree. Both batteries are an imminent fire hazard and should be disposed of immediately.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Disable shutdown on low battery

#5 Post by mxismythang »

Eadwine Rose wrote: Thu Nov 30, 2023 1:43 pm Please share the full QSI.
Edited my OP to do so.

Charlie Brown

Re: Disable shutdown on low battery

#6 Post by Charlie Brown »

mxismythang wrote: Thu Nov 30, 2023 1:36 pm... I cancel, and continue working, but within a few more seconds to a minute, the OS performs an unexpected shutdown...
You can try disabling tlp, or just play with the relevant lines (you can also install tlpui for a gui ...).

At least to try you can disable it completely:

Code: Select all

sudo nano /etc/tlp.conf
TLP_ENABLE=1

change to 0

save, close, reboot.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Disable shutdown on low battery

#7 Post by mxismythang »

Charlie Brown wrote: Thu Nov 30, 2023 3:59 pm
mxismythang wrote: Thu Nov 30, 2023 1:36 pm... I cancel, and continue working, but within a few more seconds to a minute, the OS performs an unexpected shutdown...
You can try disabling tlp, or just the relevant lines (you can also install tlpui for a gui ...).

At least to try you can disable it completely:

Code: Select all

sudo nano /etc/tlp.conf
TLP_ENABLE=1

change to 0

save, close, reboot.
Thank you for this option. I tried as you suggested, but instead of the unprompted shutdown, I received four lines of the usual text shutdown procedure and then a hang. CTRL-F7 showed a failure to invoke TLP Shutdown. It seems something is still triggering a shutdown, but with TLP disabled, it fails.

User avatar
oops
Posts: 2029
Joined: Tue Apr 10, 2018 5:07 pm

Re: Disable shutdown on low battery

#8 Post by oops »

l0dr3 wrote: Thu Nov 30, 2023 2:31 pm BOTH of yo batteries (according to the description you gave) are DEGRADED and DANGEROUS :exclamation: :exclamation: :exclamation:

PLZ - do not use them any longer (as far as you manage to get replacements ... ), REMOVE them and drive this system w#AC-POWER-ONLY :crossfingers:

A serious warning, in mind of an incident (aka 'accident' - a total burn-down of a laptop w#such degradated batteries, short before a total 'Burn-Down' of my homelab :exclamation: ), that happened to me ~ 5years ago,

greetz, l0dr3
Good to know, my eepc batterie has 10 years old, and I now have the same issue since one month , and the batterie can not be fulled completely (blinking orange led at about 90% of the charge). So it is removed now. (but I guess it is not a lithium-ion but probably a cadium-nickel tech. , so less dangerous)
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils MX Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19-23_x64 & antiX23_x32 runit

Charlie Brown

Re: Disable shutdown on low battery

#9 Post by Charlie Brown »

You can also try disabling the service completely: "MX Service Manager" from menu.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Disable shutdown on low battery  [Solved]

#10 Post by mxismythang »

In the end, nothing I did stopped the machine from acting at a self-imposed critical level. I gave up trying and a friend in the US sent me a replacement battery.

Post Reply

Return to “MX Help”