You are not logged in.
Since there is no way of getting systemctl power control work without sudo, I tried modifying sudoers to allow my user to operate them without password.
However, it still won't work.
I tried that
cross ALL = NOPASSWD: /usr/sbin/hibernate,/usr/bin/systemctl suspend,/usr/bin/systemctl reboot,/usr/bin/systemctl suspend,/usr/bin/systemctl hibernateand I tried that
cross ALL = NOPASSWD: /usr/bin/systemctlThe result was the same:
$ systemctl suspend
Failed to issue method call: Access denied
Failed to issue method call: Access denied
Last edited by impact (2012-11-09 11:28:17)
Offline
systemd very bad system. I solved this. I moved to CRUX.
Offline
You need to actually use sudo for settings in sudoers file to be used (if you want this work-around and don't have the time or the will to fix the real permissions problem).
Offline
1. I used sudo visudo
2. There is no known to me method to fix the real permissions problem which I could have found in Arch wiki, or in Arch, Gentoo, or linux.org forums.
It just stopped working after upgrading to newest polkit and that's that.
Last edited by impact (2012-11-08 13:14:00)
Offline
You used sudo visudo to change the sudoers file. Those changes affect the behavior of sudo, not the behavior of systemctl, so it's no surprise that just running systemctl (without sudo) has the same unsatifying result as before.
Last edited by Raynman (2012-11-08 13:20:37)
Offline
I did that with su, too.
Anyway, if you think you'd be able to help me with the original problem, then I invite you to the original thread:
https://bbs.archlinux.org/viewtopic.php?id=152130
Last edited by impact (2012-11-08 13:46:04)
Offline
You should be able to run power commands without sudo, if you're session is marked as enabled in "loginctl show-session (session_number)". Please check.
Offline
Yes, I know I should be able to, but it doesn't work:
$ loginctl show-session
ControlGroupHierarchy=/user
NAutoVTs=6
KillExcludeUsers=root
KillUserProcesses=no
IdleHint=yes
IdleSinceHint=0
IdleSinceHintMonotonic=0
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=ignore
PreparingForShutdown=no
PreparingForSleep=noOffline
Check with "loginctl" what's your session number, than "loginctl show-session your_session_number" please, so we'll see if your session is marked as active.
Offline
Right. But...
$ loginctl
SESSION UID USER SEAT
0 sessions listed.
$ loginctl show-session 0
Failed to issue method call: No such file or directoryOffline
Wow! Nice ![]()
"systemctl status systemd-logind.service" ?
Offline
$ systemctl status systemd-logind.service
systemd-logind.service - Login Service
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: active (running) since Thu, 2012-11-08 13:17:15 CET; 2h 32min ago
Docs: man:systemd-logind.service(8)
man:logind.conf(5)
http://www.freedesktop.org/wiki/Software/systemd/multiseat
Main PID: 338 (systemd-logind)
CGroup: name=systemd:/system/systemd-logind.service
└ 338 /usr/lib/systemd/systemd-logindOffline
Very strange. The service is up and running, but no session is listed?
How do you start x?
I don't understand how it can be possible...
Offline
Tell me about it.
I am using displaymanager-less method with automatic login as described here https://wiki.archlinux.org/index.php/Au … al_console
and starting x through ~/.bash_profile
. $HOME/.bashrc
if [ -n "$DISPLAY" ]; then
BROWSER=opera -notrayicon -nomail
fi
[[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1Offline
I'm using the same method you mentioned above...to be fair, i have no idea what kind of issue is going on there...let's wait for someone with any other idea, sorry.
Offline
As I said, things worked fine till I upgraded to the newest polkit which included native support for systemd and dropped support for consolekit.
Don't know if it's related, but it could be.
Offline
Isn't the visudo file supposed to be a comma and space separated list? I always have done /usr/sbin/poweroff, /usr/sbin/hibernate, /usr/bin/etc .
Also, systemctl suspend|hibernate|poweroff should all work without root, so long as you are the only user logged in to the machine, and your session is active.
To find your session id (if it exists) do:
$ echo $XDG_SESSION_ID Also, as long as your system is up to date, the newest update of xorg-xinit includes a new /etc/X11/xinit/xserverrc which takes care of starting your session in the correct TTY (or VT if you prefer). So I don't think that your "-- vt1" is no longer required, and possibly causing issues since it is now being istructed to start on vt1 as well as vt$XDG_VTNR.
Offline
Since there is no way of getting systemctl power control work without sudo, I tried modifying sudoers to allow my user to operate them without password.
However, it still won't work.
I tried thatcross ALL = NOPASSWD: /usr/sbin/hibernate,/usr/bin/systemctl suspend,/usr/bin/systemctl reboot,/usr/bin/systemctl suspend,/usr/bin/systemctl hibernateand I tried that
cross ALL = NOPASSWD: /usr/bin/systemctlThe result was the same:
$ systemctl suspend
Failed to issue method call: Access denied
Failed to issue method call: Access denied
you have to use "sudo systemctl suspend" still, sudoers is only affecting sudo behavior as it was mentioned...
systemd very bad system. I solved this. I moved to CRUX.
...and you registered to the forum just to tell us that? well, if I were you, i would either change the doctor or make him prescribe me another pills ![]()
core i5 4590, x86_64, nvidia 970
Offline
Also, systemctl suspend|hibernate|poweroff should all work without root, so long as you are the only user logged in to the machine, and your session is active.
To find your session id (if it exists) do:$ echo $XDG_SESSION_IDAlso, as long as your system is up to date, the newest update of xorg-xinit includes a new /etc/X11/xinit/xserverrc which takes care of starting your session in the correct TTY (or VT if you prefer). So I don't think that your "-- vt1" is no longer required, and possibly causing issues since it is now being istructed to start on vt1 as well as vt$XDG_VTNR.
I removed -- vt1 but the result of $ echo $XDG_SESSION_ID is still the same, meaning: none:
$ echo $XDG_SESSION_ID
$ Offline
Your PAM config is fubar and doesn't use pam_systemd.
Bingo. That was it.
Do you think that lack of pam_systemd.so somewhere might be also the cause of the fact that after resuming from hibernation called by 'systemctl hibernate', at the last stage of thawing laptop screen gets totally shut down (including the backlit)? System resumes just fine, but I can't see anything and I have to hard-reboot.
This does not happen if I just run 'hibernate' command.
Offline