Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1127827[details]
strace logs
+++ This bug was initially created as a clone of Bug #1205008 +++
Duplicating the above Bug report as I think the problem is likely with systemctl and therefore the systemd component/team. This is also for RedHat 7.2 instead of Fedora.
Description of problem:
Per Bug #1205008. When restarting, the session is spammed with the below text depending on command used.
---------------------------------------------------
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
---------------------------------------------------
I used a brand new RedHat 7.2 instance on AWS EC2.
$ uname -a
Linux ip-172-31-10-82.ap-southeast-2.compute.internal 3.10.0-327.4.5.el7.x86_64 #1 SMP Thu Jan 21 04:10:29 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
These are the three different commands I tired(below) which are essentially all the same given the sym link to underlying executable "/bin/systemctl".
1.
# ls -la /bin/systemctl
-rwxr-xr-x. 1 root root 645664 Oct 12 08:39 /bin/systemctl
2.
# ls -la /sbin/reboot
lrwxrwxrwx. 1 root root 16 Nov 9 20:25 /sbin/reboot -> ../bin/systemctl
3.
# ls -la /sbin/shutdown
lrwxrwxrwx. 1 root root 16 Nov 9 20:25 /sbin/shutdown -> ../bin/systemctl
If you use "sudo systemctl reboot" or "sudo reboot". Then I get
---------------------------------------------------
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
---------------------------------------------------
If I use "sudo shutdown -r now" OR "sudo shutdown -r --no-wall now" it doesn't appear.
Also doing "sudo su -" then running "systemctl reboot" or "reboot" also doesn't show the message.
Given this behaviour I suspect systemctl is doing something different depending on how it was called. When called via "reboot" or "systemctl" this something different doesn't seem to like the environment it is running in when run with sudo.
Strace logs attached for these three commands.
1. sudo nohup strace reboot > ./reboot_output.txt &
2. sudo nohup strace systemctl reboot > ./systemctl_output.txt &
3. sudo nohup strace shutdown -r --no-wall now > ./shutdown_output.txt &
Hopefully they help track down where it is doing things different. From what I can tell all three look the same/similar up to line 125 in the logs
-------------------------------------------
Line 125: ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fff976b8d70) = -1 ENOTTY (Inappropriate ioctl for device)
-------------------------------------------
(See also #1249627; not sure what is the better place to track this.)
The messages in question are from polkitagentlistener.c, perhaps through /usr/bin/pkttyagent.
So there are two basic directions of inquiry:
* Which process are they from? systemctl seems a plausible case, it does create an /usr/bin/pkttyagent fork, and the behavior differences with different ways to invoke systemctl described in comment#0 would suggest that this is somehow governed from systemctl.
OTOH none of the attached straces show systemctl forking an agent; and the socket communication patterns seem very similar in all three cases.
Jarrod, a bit more precise information could help here:
* What are the exact starting environments, in particular {real,effective} [UG]ID
- And if (sudo) vs. (su - ) vs. (ssh) matters, is perhaps sudoers configured differently ? What does (sudo id -a) say?
* What are the exact commands?
* straces should exactly match the commands showing the difference, or the difference in behavior should be in the straced processes. (I.e. if the straces are using nohup, does the same behavior difference show up when running (nohup $command) without strace?)
* Also, much larger string sizes of strace might be useful to actually show the DBus operations being performed.
* Why is polkitd terminating before whatever process is running the agent listener (i.e. probably before some users’ session)?