Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

systemctl poweroff failure

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
potuz
Guru
Guru
Posts: 378
Joined: Sat Jan 30, 2010 2:00 am

systemctl poweroff failure

  • Quote

Post by potuz » Sun Jan 13, 2019 2:57 pm

Code: Select all

# 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: Select all

#journalctl -r
systemd[1]: systemd-poweroff.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Adding

Code: Select all

[Service]
ExecStart=/usr/bin/sleep 0
Solves the issue, but how did I get to have this issue to begin with?
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Sun Jan 13, 2019 3:53 pm

Adding

Code: Select all

[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: Select all

#  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
Top
potuz
Guru
Guru
Posts: 378
Joined: Sat Jan 30, 2010 2:00 am

  • Quote

Post by potuz » Sun Jan 13, 2019 4:31 pm

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.
Top
potuz
Guru
Guru
Posts: 378
Joined: Sat Jan 30, 2010 2:00 am

  • Quote

Post by potuz » Mon Jan 14, 2019 12:21 pm

Just checked my desktop, it's systemd-240-r3. And the unit file is does not include the [Service] section

Code: Select all

$ 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
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Tue Jan 15, 2019 3:18 am

Here is the commit which removed the Service section. It doesn't look like a bug.
Top
Post Reply

5 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic