[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reasons for rights policies, political or technical ? Was : Re: pm-hibernate as user



On 19.12.2012 16:58, berenger.morel@neutralite.org wrote:
> 
> 
> Le 19.12.2012 16:25, Hugo Vanwoerkom a écrit :
>> Michael Biebl wrote:
>>> On 19.12.2012 01:04, Hugo Vanwoerkom wrote:
>>>> Michael Biebl wrote:
>>>>> On 19.12.2012 00:34, berenger.morel@neutralite.org wrote:
>>>>>> Except using sudo, I know no solution... sadly.
>>>>>> Maybe you can do something with policykit, too, I never tried to 
>>>>>> understand how it works, but I think giving rights to some 
>>>>>> softwares is its role.
>>>>> sudo is one option, the other is to use upower (which runs as 
>>>>> system
>>>>> daemon with root privileges) and use a command like this
>>>>>
>>>>>
>>>>> $ dbus-send --print-reply \
>>>>>             --system \
>>>>>             --dest=org.freedesktop.UPower \
>>>>>             /org/freedesktop/UPower \
>>>>>             org.freedesktop.UPower.Suspend
>>>>>
>>>>>
>>>> This related to LXDE which I am trying out. The hibernate and 
>>>> suspend buttons do nothing in the logout menu. Googling says that 
>>>> LXDE uses pm-utils. So I was guessing that invoking 
>>>> pm-hibernate/suspend was involved, which I can do as root but not as 
>>>> user.
>>> Since the user session runs unprivileged, and 
>>> pm-suspend/pm-hibernate
>>> need to run as root, you will need to go through a system service 
>>> like
>>> upower.
>>> I know nothing about LXDE, but e.g. in GNOME, the power manager 
>>> simply
>>> sends the above dbus requests when you hit the suspend button or 
>>> close
>>> the lid.
>>> I would expect LXDE provides a similar user power management agent.
>>>
>>>
>>
>> Indeed. I found this:
>> https://wiki.archlinux.org/index.php/PolicyKit#Suspend_and_hibernate
>>
>> Follow that and addgroup power and adduser to power and you can now
>> hibernate and suspend.
>>
>> Hugo
> 
> A bit out of topic, but I wonder why there is no other solution than 
> using dbus to let a user shutdown/hibernate/suspend his computer? This 
> is not the only point where the problem apply: you have same troubles 
> with network, and maybe on other things I did not experiment (to add 
> softwares and/or modify system-wide configuration files, I think it is 
> perfectly normal to need root, because no normal user does those actions 
> everyday).
> 
> Of course, there are workarounds, with dbus, sudo...
> Of course, the way things are actually done is nice for enterprises, 
> which need a high security level, at least for servers.

See my recent post: Make sure your desktop environment is setting up a
up proper consolekit session. Then stuff like that will work ootb.
E.g. if you are using KDE and GNOME you won't have to deal with that.

I'd say this is the price you pay for dealing with a more minimalist DE
like LXDE.

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: