Bug 1933335

Summary: No longer able to reboot from terminal without authentication
Product: [Fedora] Fedora Reporter: grumpey0
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 34CC: fedoraproject, filbranden, flepied, kasong, lnykryn, msekleta, ssahani, s, systemd-maint, yuwatana, zbyszek, z
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-248~rc3-1.fc35 systemd-248~rc4-3.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-25 00:18:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description grumpey0 2021-02-26 18:38:41 UTC
Description of problem:
Unable to reboot from terminal

Version-Release number of selected component (if applicable):
systemd 248 (v248~rc2-1.fc34)

How reproducible:
Attempting to reboot from terminal or systemctl reboot from a terminal

Steps to Reproduce:
1. Log in
2. Open Terminal
3. Type Reboot <enter>
4. Authentication window opens for password. 

Actual results:
From sway session, polkit agent opens (xfce-polkit) if password is entered machine reboots. 
From gnome session, polkit agent opens, if password is entered machine reboots. 
From a virtual console:
Failed to reboot system via logind: Access denied
Failed to open initctl fifo: Permission denied
Failed to talk to init daemon.

Expected results:
Prior behavior was to have machine reboot without password. 

Additional info:
Rebooting via GNOME GUI appears to function. 

Feb 26 13:38:05 grumpey polkitd[716]: <no filename>:2: action=[Action id='org.freedesktop.systemd1.manage-units' verb='start' unit='reboot.target' polkit.message='Authentication is required to start '$(unit)'.' polkit.gettext_domain='systemd']
Feb 26 13:38:05 grumpey polkitd[716]: <no filename>:3: subject=[Subject pid=4609 user='grumpey' groups=grumpey,wheel seat='seat0' session='5' local=true active=true]
Feb 26 13:38:05 grumpey polkitd[716]: <no filename>:2: action=[Action id='org.freedesktop.systemd1.manage-unit-files' verb='start' unit='reboot.target' polkit.message='Authentication is required to start '$(unit)'.' polkit.gettext_domain='systemd']
Feb 26 13:38:05 grumpey polkitd[716]: <no filename>:3: subject=[Subject pid=4609 user='grumpey' groups=grumpey,wheel seat='seat0' session='5' local=true active=true]
Feb 26 13:38:07 grumpey polkitd[716]: Operator of unix-session:5 FAILED to authenticate to gain authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.222 [systemctl reboot] (owned by unix-user:grumpey)


This appears to work: 
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true

Comment 1 grumpey0 2021-03-08 23:14:13 UTC
Additional Data:
This is an upgrade from F33 -> F34 thatincluded an update to systemd 248. That upgrade was done with an offline upgrade.
After upgrading to: systemd 248 (v248~rc2-3.fc34)

reboot:
Mar 08 16:40:27 grumpey dbus-broker[745]: A security policy denied :1.156 to send method call /org/freedesktop/login1:org.freedesktop.login1.Manager.RebootWithFlags to org.freedesktop.login1.
Mar 08 16:40:27 grumpey polkitd[775]: <no filename>:2: action=[Action id='org.freedesktop.systemd1.manage-units' verb='start' unit='reboot.target' polkit.message='Authentication is required to start '$(unit)'.'  polkit.gettext_domain='systemd']
Mar 08 16:40:27 grumpey polkitd[775]: <no filename>:3: subject=[Subject pid=4642 user='grumpey' groups=grumpey,wheel,media seat=null session=null local=true active=true]
Mar 08 16:40:27 grumpey polkitd[775]: <no filename>:2: action=[Action id='org.freedesktop.systemd1.manage-unit-files' verb='start' unit='reboot.target' polkit.message='Authentication is required to start '$(unit)'.' polkit.gettext_domain='systemd']
Mar 08 16:40:27 grumpey polkitd[775]: <no filename>:3: subject=[Subject pid=4642 user='grumpey' groups=grumpey,wheel,media seat=null session=null local=true active=true]
Mar 08 16:40:29 grumpey polkitd[775]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.156 [reboot] (owned by unix-user:grumpey)

Similar messages observed for shutdown and suspend.

Comment 2 Zbigniew Jędrzejewski-Szmek 2021-03-09 08:13:55 UTC
https://github.com/systemd/systemd/pull/18933

Comment 3 grumpey0 2021-03-09 11:58:50 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #2)
> https://github.com/systemd/systemd/pull/18933

Thanks!!

Comment 4 Fedora Update System 2021-03-23 14:06:55 UTC
FEDORA-2021-ea92e5703f has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ea92e5703f

Comment 5 Fedora Update System 2021-03-24 02:44:09 UTC
FEDORA-2021-ea92e5703f has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ea92e5703f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ea92e5703f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-03-25 00:18:39 UTC
FEDORA-2021-ea92e5703f has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.