You are not logged in.
Hi all,
I'm running StumpWM with no desktop environment, and in the past was able to shut down the machine from within an xterm as a regular user using 'systemctl poweroff' (or systemctl reboot to reboot, etc). I recently started using urxvt in daemon mode as my console program because it seemed like a clean solution to having multiple consoles open. From within urxvt, when I try to run systemctl poweroff, I get the following error:
$ systemctl poweroff
Failed to execute operation: Interactive authentication required.
Failed to start poweroff.target: Interactive authentication required.I can start an xterm and shutdown from there, or use Ctrl-Alt-F2 and log in to a non-X tty and shut down there, all as a regular user.
I've seen other posts where the information in loginctl session-status c1 was requested, so here it is:
$ loginctl session-status c1
c1 - Lefty (1000)
Since: Sun 2014-12-07 16:51:25 CST; 13min ago
Leader: 1104 (login)
Seat: seat0; vc1
TTY: tty1
Service: login; type tty; class user
State: active
Unit: session-c1.scope
├─1104 login -- Lefty
├─3005 /bin/sh /usr/bin/startx
├─3317 gpg-agent --daemon --enable-ssh-support --write-env-file /home/Lefty/.gnupg/gpg-agent.env
├─4525 xinit /home/Lefty/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -auth /tmp/serverauth.SrQT9ulZaj
├─4583 /usr/bin/Xorg.bin -nolisten tcp :0 vt1 -auth /tmp/serverauth.SrQT9ulZaj vt1
├─5502 xf86-video-intel-backlight-helper acpi_video0
├─6155 /home/Lefty/Downloads/Stumpwm/stumpwm/stumpwm
├─7066 xulrunner /usr/share/conkeror/application.ini
├─7097 /usr/bin/dbus-launch --autolaunch be7bdc12ca34453d943a6560e1975268 --binary-syntax --close-stderr
├─7098 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
└─7224 /opt/google/talkplugin/GoogleTalkPluginIt doesn't look like I'm showing up as a remote user. And the output is the same when run from an xterm. Any idea what I'm doing wrong in urxvt?
Thanks!
-Lefty
Last edited by LeftyAce (2014-12-08 17:09:55)
Offline
How do you login and start X?
Offline
I auto-login. /etc/systemd/system/getty@tty1.service.d/autologin.conf looks like this:
[Service]
Type=simple
ExecStart=
ExecStart=-/usr/bin/agetty --autologin owen --noclear %I 38400 linuxThen .bash_profile starts X:
[[ -f ~/.bashrc ]] && . ~/.bashrc
if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then
exec startx
fiAnd .xinitrc starts stumpwm (this is sounding more and more like a mess. I swear it works great :-)
rdb -merge ~/.Xresources
systemd --user &
sudo trackpoint
numlockx &
xset -dpms s off
exec /home/Lefty/Downloads/Stumpwm/stumpwm/stumpwmOffline
Odd. I have no problems with urxvt{c,d}. Does each instance of urxvtc inherit all your environment variables?
Offline
It looks like all my environment variables are present in urxvtc. A few extras are present as well (COLORTERM, COLORFGBG).
Offline
And other systemctl commands all work, presumably?
Is it just in daemon mode that you see this?
Offline
It seems to only be a problem in daemon mode. If I start urxvt not in daemon mode I can power off as normal.
Other systemctl commands like systemctl list-units work fine in daemon mode.
Offline
How (and where) are you starting urxvtd?
Offline
I created a file called /etc/systemd/system/urxvtd@.service (based on this wiki page: https://wiki.archlinux.org/index.php/rx … gh_systemd ) and enabled it using
systemctl enable urxvtd@lefty.service Offline
And if you just start it in your .xinitrc, it works fine...
urxvtd -q -o -fOffline
That works great, thank you so much! It seems I got led astray by the systemd/daemon section of the wiki page.
Offline
What about the info in the wiki? Should it be fixed?
Last edited by karol (2014-12-08 16:17:25)
Offline
The wiki page doesn't mention starting the daemon using .xinitrc at all. The section about using the daemon mode only describes two ways to start it through systemd (https://wiki.archlinux.org/index.php/rx … gh_systemd).
At the very least, it looks like I should add a section on using the daemon/client setup in a single user system (through .xinitrc).
Is there a reason someone would _not_ want to run it this way? Does it cause problems for multi-user systems?
EDIT: I updated the page to include .xinitrc instructions and to add a note to the systemd section mentioning the problem with power on/power off. If anyone has more information about why the systemd configuration is desirable I would be happy to add that information as well.
Last edited by LeftyAce (2014-12-08 17:02:23)
Offline
The second service file on that page includes the ENV: I suspect it is related to that.
I don't know why a service file is recommended, tbh. If you have an .xinitrc, it makes sense to start X-dependent apps in it.
Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.
Offline
Done, thanks!
Offline