View previous topic :: View next topic |
Author |
Message |
potuz Guru
Joined: 30 Jan 2010 Posts: 378
|
Posted: Sun Jan 13, 2019 2:57 pm Post subject: systemctl poweroff failure |
|
|
Code: |
# systemctl poweroff
Failed to power off system via logind: Unit systemd-poweroff.service has a bad unit file setting.
Failed to start poweroff.target: Unit systemd-poweroff.service has a bad unit file setting.
See system logs and 'systemctl status poweroff.target' for details.
|
Code: |
#journalctl -r
systemd[1]: systemd-poweroff.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
|
Adding
Code: |
[Service]
ExecStart=/usr/bin/sleep 0
|
Solves the issue, but how did I get to have this issue to begin with? |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sun Jan 13, 2019 3:53 pm Post subject: |
|
|
Quote: | Adding
Code: | [Service]
ExecStart=/usr/bin/sleep 0 |
|
To which file did you add that? To '/lib/systemd/system/systemd-poweroff.service'?
On my machine, '/lib/systemd/system/systemd-poweroff.service' was installed by sys-apps/systemd-239-r3. Below is the contents of the file:
Code: | # SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Power-Off
Documentation=man:systemd-halt.service(8)
DefaultDependencies=no
Requires=shutdown.target umount.target final.target
After=shutdown.target umount.target final.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl --force poweroff |
|
|
Back to top |
|
|
potuz Guru
Joined: 30 Jan 2010 Posts: 378
|
Posted: Sun Jan 13, 2019 4:31 pm Post subject: |
|
|
Interesting, my service unit file lacked the [Service] section. It was installed by systemd. Can't recall the version of the last update and I'm far from that box. But my laptop running systemd-239-r2 does have the same service file as yours. I am certain I did not change that file. |
|
Back to top |
|
|
potuz Guru
Joined: 30 Jan 2010 Posts: 378
|
Posted: Mon Jan 14, 2019 12:21 pm Post subject: |
|
|
Just checked my desktop, it's systemd-240-r3. And the unit file is does not include the [Service] section
Code: |
$ tar -x -f /usr/portage/distfiles/systemd-240.tar.gz systemd-240/units/systemd-poweroff.service
$ $ cat systemd-240/units/systemd-poweroff.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Power-Off
Documentation=man:systemd-halt.service(8)
DefaultDependencies=no
Requires=shutdown.target umount.target final.target
After=shutdown.target umount.target final.target
SuccessAction=poweroff-force
|
Haven't checked if systemd-240-patches-2.tar.gz include patches for this nor have I gone to figure out if this is a bug upstream or in the Gentoo distribution.
Opened https://bugs.gentoo.org/show_bug.cgi?id=675394 |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Tue Jan 15, 2019 3:18 am Post subject: |
|
|
Here is the commit which removed the Service section. It doesn't look like a bug. |
|
Back to top |
|
|
|