You are not logged in.

#1 2014-12-07 23:08:49

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

[Solved] Cannot poweroff/reboot in urxvt

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/GoogleTalkPlugin

It 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

#2 2014-12-07 23:30:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

How do you login and start X?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-12-07 23:38:51

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

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 linux

Then .bash_profile starts X:

[[ -f ~/.bashrc ]] && . ~/.bashrc

if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then
    exec startx
fi

And .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/stumpwm

Offline

#4 2014-12-07 23:50:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

Odd. I have no problems with urxvt{c,d}. Does each instance of urxvtc inherit all your environment variables?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-12-07 23:55:45

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

It looks like all my environment variables are present in urxvtc. A few extras are present as well (COLORTERM, COLORFGBG).

Offline

#6 2014-12-08 00:02:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

And other systemctl commands all work, presumably?

Is it just in daemon mode that you see this?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-12-08 03:10:30

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

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

#8 2014-12-08 06:58:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

How (and where) are you starting urxvtd?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2014-12-08 15:16:18

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

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

#10 2014-12-08 15:58:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

And if you just start it in your .xinitrc, it works fine...

urxvtd -q -o -f

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2014-12-08 16:15:07

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

That works great, thank you so much! It seems I got led astray by the systemd/daemon section of the wiki page.

Offline

#12 2014-12-08 16:16:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Cannot poweroff/reboot in urxvt

What about the info in the wiki? Should it be fixed?

Last edited by karol (2014-12-08 16:17:25)

Offline

#13 2014-12-08 16:53:27

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

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

#14 2014-12-08 17:07:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Cannot poweroff/reboot in urxvt

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.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#15 2014-12-08 17:10:58

LeftyAce
Member
Registered: 2012-08-18
Posts: 162

Re: [Solved] Cannot poweroff/reboot in urxvt

Done, thanks!

Offline

Board footer

Powered by FluxBB