You are not logged in.

#1 2016-07-16 11:10:38

joanmanel
Member
Registered: 2012-11-06
Posts: 234

[solved] User cannot reboot in i3wm using nodm

If I try:

systemctl reboot
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.

if I try instead sudo systemctl reboot, it works. And I have already disabled the fact that it asks for a password.

The problem is that in i3wm I wanted to reboot using a hot key, like mod+end. I have:

set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
    bindsym l exec --no-startup-id $Locker, mode "default"
    bindsym e exec --no-startup-id i3-msg exit, mode "default"
    bindsym s exec --no-startup-id $Locker && suspend, mode "default"
    bindsym h exec --no-startup-id $Locker && hibernate, mode "default"
    bindsym r exec --no-startup-id reboot, mode "default"
    bindsym Shift+s exec --no-startup-id poweroff -i, mode "default"  

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym $mod+End mode "$mode_system"

The menu appears, but once I type "r" for example, it does nothing. And I assume this goes back to the first error before.

I tried changing it for "sudo systemctl reboot", and I get the same error.

in my .bashrc I have:

alias reboot="sudo systemctl reboot"
alias poweroff="sudo systemctl poweroff"
alias halt="sudo systemctl halt"
alias suspend="sudo systemctl suspend"
alias hibernate="sudo systemctl hibernate"

and my sudoers

user group =NOPASSWD: /usr/bin/systemctl poweroff,/usr/bin/systemctl halt,/usr/bin/systemctl reboot

user and group are the real ones.

I don't really know if nodm is causing the problem, because the user in my system is not myself. But when I open a term, it goes to my home.

Last edited by joanmanel (2016-07-17 10:36:35)

Offline

#2 2016-07-16 11:15:44

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: [solved] User cannot reboot in i3wm using nodm

The reboot and poweroff binaries already exist on a normal Arch system in /usr/bin/{reboot, poweroff}. Have you tried them instead of systemd?

Offline

#3 2016-07-16 11:23:51

joanmanel
Member
Registered: 2012-11-06
Posts: 234

Re: [solved] User cannot reboot in i3wm using nodm

Awebb wrote:

The reboot and poweroff binaries already exist on a normal Arch system in /usr/bin/{reboot, poweroff}. Have you tried them instead of systemd?

so I just tried from the term /usr/bin/reboot and it does work.

But then I went to i3 config file, and I swapped reboot with that, and it does not work.

Offline

#4 2016-07-16 11:48:26

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: [solved] User cannot reboot in i3wm using nodm

Well, nodm depends uses PAM, but I think this kind of authentication is usually handled by policykit. Could you see whether there is an instance of polkitd running on your system? I start i3 just with xinit on tty1 from my .bash_profile and those commands work.

See the wiki articles of PAM and policykit, if necessary.

Offline

#5 2016-07-16 11:58:28

joanmanel
Member
Registered: 2012-11-06
Posts: 234

Re: [solved] User cannot reboot in i3wm using nodm

Awebb wrote:

Well, nodm depends uses PAM, but I think this kind of authentication is usually handled by policykit. Could you see whether there is an instance of polkitd running on your system? I start i3 just with xinit on tty1 from my .bash_profile and those commands work.

See the wiki articles of PAM and policykit, if necessary.

Yeah there is an instance of polkitd running.

my bash_profile is basically empty, and my bashrc basically have the aliases said before.

nodm executes my .xinitrc, and there you can just find a "exec i3"

Offline

#6 2016-07-16 12:39:51

damjan
Member
Registered: 2006-05-30
Posts: 452

Re: [solved] User cannot reboot in i3wm using nodm

IMHO, aliases in .bashrc will not be activated by i3 since .bashrc is only sourced for interactive shells.

put the whole commands that are allowed sudoers in the i3 exec line
so `sudo /usr/bin/systemctl reboot`

Offline

#7 2016-07-16 17:28:35

joanmanel
Member
Registered: 2012-11-06
Posts: 234

Re: [solved] User cannot reboot in i3wm using nodm

damjan wrote:

IMHO, aliases in .bashrc will not be activated by i3 since .bashrc is only sourced for interactive shells.

put the whole commands that are allowed sudoers in the i3 exec line
so `sudo /usr/bin/systemctl reboot`

This did work, thanks!

Offline

Board footer

Powered by FluxBB