1 |
on Saturday 21 March 2015 13:58:45,Canek Peláez Valdés wrote: |
2 |
> On Sat, Mar 21, 2015 at 1:47 PM, Rich Freeman <rich0@g.o> wrote: |
3 |
> > On Sat, Mar 21, 2015 at 3:39 PM, German <gentgerman@×××××.com> wrote: |
4 |
> > > No, I am trying to shutdown from a console |
5 |
> > |
6 |
> > Well, the old answer would be that you need to use sudo to run it, as |
7 |
> > shutting down is a privileged operation. |
8 |
> > |
9 |
> > I suspect that the new answer is that with appropriate |
10 |
> > policykit/consolekit/etc settings you can probably allow somebody |
11 |
> > sitting at a physical console to shut down the system, or any |
12 |
> > logged-in user if you prefer. However, I haven't actually set that up |
13 |
> > myself. |
14 |
> |
15 |
> logind does that for you automagically™. The first seat has the rights to |
16 |
> poweroff or reboot the machine, and it can differentiate between local and |
17 |
> remote logins. You can check if your user session has the permissions to |
18 |
> poweroff/reboot via dbus: |
19 |
> |
20 |
> $ gdbus call --system --dest org.freedesktop.login1 --object-path |
21 |
> /org/freedesktop/login1 --method org.freedesktop.login1.Manager.CanPowerOff |
22 |
> ('yes',) |
23 |
> |
24 |
> $ gdbus call --system --dest org.freedesktop.login1 --object-path |
25 |
> /org/freedesktop/login1 --method org.freedesktop.login1.Manager.CanReboot |
26 |
> ('yes',) |
27 |
> |
28 |
> But you need systemd to use logind1. There has been some attempts to |
29 |
> reimplement logind outside systemd, but I'm not sure how advanced they are. |
30 |
> |
31 |
> This kind of problems were one of the reasons for creating logind. |
32 |
> |
33 |
|
34 |
and dump people keep talking nonsencely that sysvinit is enough while it |
35 |
cannot even handle reboot for normal user. sad. |
36 |
|
37 |
|
38 |
> Regards. |
39 |
> -- |
40 |
> Canek Peláez Valdés |
41 |
> Profesor de asignatura, Facultad de Ciencias |
42 |
> Universidad Nacional Autónoma de México |