linrunner / TLP

TLP - Optimize Linux Laptop Battery Life
https://linrunner.de/tlp
GNU General Public License v2.0
2.51k stars 129 forks source link

Should TLP start after multi-user.target? #697

Closed AkinoKaede closed 12 months ago

AkinoKaede commented 12 months ago

When I exec systemctl start tlp to start tlp, it will be stucks. multi-user.target was not reached which caused by udev stucks.

I deleted multi-user.target in After from systemd file, it was fixed.

So should TLP run after multi-user.target?

I had a similar problem with other software. EmixamPP/linux-enable-ir-emitter#101

# /usr/lib/systemd/system/tlp.service

# tlp - systemd startup/shutdown service
#
# Copyright (c) 2022 Thomas Koch <linrunner at gmx.net> and others.
# This software is licensed under the GPL v2 or later.

[Unit]
Description=TLP system startup/shutdown
After=NetworkManager.service
Before=shutdown.target
Documentation=https://linrunner.de/tlp

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tlp init start
ExecReload=/usr/bin/tlp start
ExecStop=/usr/bin/tlp init stop

[Install]
WantedBy=multi-user.target
AkinoKaede commented 12 months ago

In my view, I think multi-user.target should be reached after TLP started. But TLP will be started after multi-user.target currently .

linrunner commented 12 months ago

Hi. Works as designed. tlp.service should run as late as possible in the boot process, hence the After=multi-user.target.

  1. Does this happen during boot or only when you start the service manually?
  2. What exactly is meant by stucks: does the command hang/not complete or does the system freeze?

Generally I require complete outputs as described in the issue template. Provide them via https://gist.github.com/ please.


AkinoKaede commented 12 months ago

Hi. Works as designed. tlp.service should run as late as possible in the boot process, hence the After=multi-user.target.

  1. Does this happen during boot or only when you start the service manually?
  2. What exactly is meant by stucks: does the command hang/not complete or does the system freeze?

Generally I require complete outputs as described in the issue template. Provide them via https://gist.github.com/ please.

Thanks, the issues is solved.

Both, this is because the system hangs before reach the multi-user.target, so TLP can not be started. This is expected behavior for TLP. And this is caused by other programs, so there is no need to debug TLP。

linrunner commented 11 months ago

I see. Thanks for the feedback.