You are not logged in.
How can I Poweroff and Reboot my system without using sudo?
Last edited by aldoiljazi (2013-09-18 06:52:28)
Offline
Also in the wiki ![]()
Offline
Outdated, but maybe still helpful: https://wiki.archlinux.org/index.php/Al … o_Shutdown
Edit: Why do you want to reboot w/o sudo anyway?
Last edited by karol (2013-09-16 14:42:27)
Offline
I saw those, and they are outdated. Well I don't want to type my password each time I reboot.
Offline
Did you try any of the solutions recommended by the wiki topic? "systemctl poweroff" should work.
Last edited by 2ManyDogs (2013-09-16 15:03:23)
Offline
I get
$ systemctl poweroff
Failed to issue method call: Access denied
Failed to issue method call: Access deniedOffline
Users shouldn't be allowed to do things like installing / updating packages, rebooting or powering off the computer etc. You need to use sudo because of security.
If you don't want to type your password in when using sudo, follow the wiki.
Offline
Okay thanks.
Offline
@karol: systemd assumes that anyone with console access can shutdown/reboot the computer anyway (as they are sitting at the computer). Therefore, he should be able to issue `systemctl poweroff` etc. iff his session is setup correctly.
What is the output of `loginctl show-session $XDG_SESSION_ID`?
Offline
@Stebalien
The wiki has
# systemctl poweroffso I guess it's a typo, right?
I can't check if 'systemctl poweroff' works for me atm, but
$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Mon 2013-09-16 16:22:30 CEST
TimestampMonotonic=18752776
VTNr=1
TTY=tty1
Remote=no
Service=login
Scope=session-1.scope
Leader=171
Audit=1
Type=tty
Class=user
Active=yes
State=active
IdleHint=yes
IdleSinceHint=1379341352989405
IdleSinceHintMonotonic=21376821
Name=karolOffline
"poweroff" and "systemctl poweroff" are equivalent, "poweroff" is symlinked to systemctl. As mentioned, these should work just fine without password if you are in an active session (@Karol, your session seems to be fine).
Offline
@aldoiljazi - You might want to check that you have polkit installed.
Offline
I was using old aliases for reboot / poweroff, but you're right, 'poweroff' and 'reboot' work w/o sudo.
Please check if my edits make sense https://wiki.archlinux.org/index.php?ti … did=275784
If I have more questions, I will open a new thread not to derail this one.
Offline
@karol: man poweroff (which references halt & reboot as well) says
NOTES
These are legacy commands available for compatibility only.
so maybe
systemctl poweroffis more appropriate
Offline
You're right. Fixed.
Offline
@karol: systemd assumes that anyone with console access can shutdown/reboot the computer anyway (as they are sitting at the computer). Therefore, he should be able to issue `systemctl poweroff` etc. iff his session is setup correctly.
What is the output of `loginctl show-session $XDG_SESSION_ID`?
$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Mon 2013-09-16 21:11:47 EEST
TimestampMonotonic=13019390
DefaultControlGroup=systemd:/user/1000.user/1.session
VTNr=1
TTY=tty1
Remote=no
Service=login
Leader=130
Audit=1
Type=tty
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=yes
IdleSinceHint=1379355104466900
IdleSinceHintMonotonic=10330073
Name=aldomine.
Last edited by aldoiljazi (2013-09-16 19:47:04)
Offline
@aldoiljazi
Does
systemctl poweroffwork for you w/o sudo?
Offline
@aldoiljazi
Doessystemctl poweroffwork for you w/o sudo?
No, I get:
Failed to issue method call: Access denied
Failed to issue method call: Access denied![]()
Offline
Are you sure you have polkit installed?
If so, reboot and try again.
Offline
Why does karol's have Scope and aldoiljazi's has DefaultControlGroup but not vice versa?
Note: I'm just curious - I'm not claiming this explains anything.
EDIT: I'm guessing karol is using testing and aldoiljazi is not (http://upstream-tracker.org/changelogs/ … gelog.html).
Last edited by cfr (2013-09-17 01:36:14)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
@cfr, karol runs [testing]. There have been some changes to systemd between what is in [core] (v204) and [testing] (v207).
Offline
Yup, I'm using [testing]. Sorry for forgetting about it.
Offline
Yes I am not using [testing].
PS: Should I install polkit?
Offline
Yes you should.
Offline