Gentoo Archives: gentoo-user

From: Willie Matthews <matthews.willie80@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Shutdown through systemctl as a normal user
Date: Mon, 18 Jan 2016 22:56:47
Message-Id: 20160118145625.757a0aac@thinkpad.Home
In Reply to: Re: [gentoo-user] Shutdown through systemctl as a normal user by lukash
1 On Mon, 18 Jan 2016 23:31:39 +0100
2 lukash <lukkash@×××××.cz> wrote:
3
4 > On Mon, 2016-01-18 at 20:00 +0100, wabenbau@×××××.com wrote:
5 > > lukash <lukkash@×××××.cz> wrote:
6 > >
7 > > > Hi all,
8 > > >
9 > > > I'm reading on the internet that systemctl poweroff should work
10 > > > for normal user if he is the only one logged in, he is logged in
11 > > > locally
12 > > > and his session is active. I seem to be meeting these conditions:
13 > > >
14 > > > # loginctl
15 > > >    SESSION        UID USER             SEAT
16 > > >          2       1000 lukash           seat0
17 > > >
18 > > > $ loginctl show-session 2
19 > > > Id=2
20 > > > User=1000
21 > > > Name=lu
22 > > > Timestamp=Sat 2016-01-16 17:27:30 CET
23 > > > TimestampMonotonic=9614418
24 > > > VTNr=7
25 > > > Seat=seat0
26 > > > Display=:0
27 > > > Remote=no
28 > > > Service=lightdm
29 > > > Desktop=awesome
30 > > > Scope=session-2.scope
31 > > > Leader=529
32 > > > Audit=2
33 > > > Type=x11
34 > > > Class=user
35 > > > Active=yes
36 > > > State=active
37 > > > IdleHint=no
38 > > > IdleSinceHint=0
39 > > > IdleSinceHintMonotonic=0
40 > > >
41 > > > But invoking the command gives me:
42 > > >
43 > > > $ systemctl poweroff
44 > > > Failed to set wall message, ignoring: Access denied
45 > > > Failed to power off system via logind: Access denied
46 > > > Failed to start poweroff.target: Access denied
47 > > >
48 > > > How is this supposed to work on Gentoo?
49 > > >
50 > > > Thanks in advance,
51 > > > Lukas
52 > >
53 > > IIRC "CONFIG_AUDIT" and "CONFIG_HAVE_ARCH_AUDITSYSCALL" must be set
54 > > in the kernel configuration. But as I don't use this method I cannot
55 > > say this for sure.
56 >
57 > Thanks. But I've got those in my kernel already...
58 >
59 > > --
60 > > Regards
61 > > wabe
62 > >
63 >
64
65 Try this https://wiki.archlinux.org/index.php/allow_users_to_shutdown ,
66 I think you might be happy with it. I don't have systemd personally so
67 I don't have any experience with it. From what I read on the wiki,
68 this will be an easy fix.
69
70 Instead of using users in the "Users without sudo privileges" section, I
71 think you can also use groups without the hostname. All you would have
72 to do is make a group that you would like to be able to shutdown or
73 whatever with the computer.
74
75 --
76
77 Willie Matthews
78 matthews.willie80@×××××.com
79 (702) 659-9966

Replies

Subject Author
Re: [gentoo-user] Shutdown through systemctl as a normal user lukash <lukkash@×××××.cz>