FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-28-2011, 12:35 PM
Klistvud
 
Default Prevent shutdown in Gnome

Dne, 28. 03. 2011 13:22:10 je Paul van der Vlis napisal(a):

Hello,

I would like to remove the shutdown option in the Gnome menu, it's to
prevent shutdown by mistake. Is here somebody who knows how?


/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy

Back it up first, then change the "yes" to a "no" where appropriate.
There are settings for the active user and for inactive users. There
are also settings for rebooting the computer. It's all pretty well
commented anyway.





With regards,
Paul van der Vlis.




--
http://www.vandervlis.nl/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org

Archive: http://lists.debian.org/4D906F62.4070100@vandervlis.nl








--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1301315725.21439.1@compax">http://lists.debian.org/1301315725.21439.1@compax
 
Old 03-28-2011, 06:33 PM
Paul van der Vlis
 
Default Prevent shutdown in Gnome

Op 28-03-11 14:35, Klistvud schreef:
> Dne, 28. 03. 2011 13:22:10 je Paul van der Vlis napisal(a):
>> Hello,
>>
>> I would like to remove the shutdown option in the Gnome menu, it's to
>> prevent shutdown by mistake. Is here somebody who knows how?
>
> /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
>
> Back it up first, then change the "yes" to a "no" where appropriate.
> There are settings for the active user and for inactive users. There are
> also settings for rebooting the computer. It's all pretty well commented
> anyway.

Thanks for your information!

It's not so easy for me to test this (the system is in use), but I will
do this the coming days.


With regards,
Paul van der Vlis.




--
http://www.vandervlis.nl/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D90D47E.7050708@vandervlis.nl">http://lists.debian.org/4D90D47E.7050708@vandervlis.nl
 
Old 03-28-2011, 07:29 PM
Liam O'Toole
 
Default Prevent shutdown in Gnome

On 2011-03-28, Klistvud <quotations@aliceadsl.fr> wrote:
> Dne, 28. 03. 2011 13:22:10 je Paul van der Vlis napisal(a):
>> Hello,
>>
>> I would like to remove the shutdown option in the Gnome menu, it's to
>> prevent shutdown by mistake. Is here somebody who knows how?
>
> /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
>
> Back it up first, then change the "yes" to a "no" where appropriate.
> There are settings for the active user and for inactive users. There
> are also settings for rebooting the computer. It's all pretty well
> commented anyway.

While the solution given above will work, it is not ideal. The file
/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy is not a
configuration file and will be overwritten without warning on upgrade of
the consolekit package.

I looked into this problem last month (following the release of squeeze)
and, after much head scratching and reading of the man page for
pklocalauthority (and then more head scratching), I arrived at the
following alternative solution.

Create a file in the directory /etc/polkit-1/localauthority/50-local.d/.
Ensure that the name of the file is unique and that it ends in .pkla. To
prevent shutdown and poweroff, and a stanza such as the following to the
file:

[consolekit]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.*
ResultAny=no
ResultInactive=no
ResultActive=no

To prevent suspend and hibernate, add this stanza:

[upower]
Identity=unix-user:*
Action=org.freedesktop.upower.*
ResultAny=no
ResultInactive=no
ResultActive=no

The result will be that the relevant options are removed from the System
menu in GNOME. They will still be present at the login screen, but will
be ignored. (The integration of GDM3 and consolekit is still clearly a
work in progress.)

It shouldn't be as difficult as indicated above, but that's the way it
is. Note that GDM2 is still available in squeeze, so the administrator
can revert to the old way of restricting user actions if desired.

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnip1obv.20h.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnip1obv.20h.liam.p.otoole@dipsy.tubbynet
 
Old 03-29-2011, 07:03 AM
Tom H
 
Default Prevent shutdown in Gnome

On Mon, Mar 28, 2011 at 3:29 PM, Liam O'Toole <liam.p.otoole@gmail.com> wrote:
> On 2011-03-28, Klistvud <quotations@aliceadsl.fr> wrote:
>> Dne, 28. 03. 2011 13:22:10 je Paul van der Vlis napisal(a):
>>>
>>> I would like to remove the shutdown option in the Gnome menu, it's to
>>> prevent shutdown by mistake. Is here somebody who knows how?
>
> I looked into this problem last month (following the release of squeeze)
> and, after much head scratching and reading of the man page for
> pklocalauthority (and then more head scratching), I arrived at the
> following alternative solution.
>
> Create a file in the directory /etc/polkit-1/localauthority/50-local.d/.
> Ensure that the name of the file is unique and that it ends in .pkla. To
> prevent shutdown and poweroff, and a stanza such as the following to the
> file:
>
> * * * *[consolekit]
> * * * *Identity=unix-user:*
> * * * *Action=org.freedesktop.consolekit.system.*
> * * * *ResultAny=no
> * * * *ResultInactive=no
> * * * *ResultActive=no
>
> To prevent suspend and hibernate, add this stanza:
>
> * * * *[upower]
> * * * *Identity=unix-user:*
> * * * *Action=org.freedesktop.upower.*
> * * * *ResultAny=no
> * * * *ResultInactive=no
> * * * *ResultActive=no
>
> The result will be that the relevant options are removed from the System
> menu in GNOME. They will still be present at the login screen, but will
> be ignored.

Doesn't that prevent anyone from shutting down, etc without su-ing to
root in a terminal and doing so there?

Wouldn't "ResultActive=auth_admin" be better? (IIUC, you'd have to
supply the root password in order to shut down, etc.)

I'd add "man polkit" to "man pklocalauthority" as *interesting* reading...


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTikK2chgk1bxEogLUt_E5Ffio8efSHKnmSgCW8VS@mail .gmail.com">http://lists.debian.org/AANLkTikK2chgk1bxEogLUt_E5Ffio8efSHKnmSgCW8VS@mail .gmail.com
 
Old 03-29-2011, 08:34 AM
Liam O'Toole
 
Default Prevent shutdown in Gnome

On 2011-03-29, Tom H <tomh0665@gmail.com> wrote:
> On Mon, Mar 28, 2011 at 3:29 PM, Liam O'Toole <liam.p.otoole@gmail.com> wrote:
>> On 2011-03-28, Klistvud <quotations@aliceadsl.fr> wrote:
>>> Dne, 28. 03. 2011 13:22:10 je Paul van der Vlis napisal(a):
>>>>
>>>> I would like to remove the shutdown option in the Gnome menu, it's to
>>>> prevent shutdown by mistake. Is here somebody who knows how?
>>
>> I looked into this problem last month (following the release of squeeze)
>> and, after much head scratching and reading of the man page for
>> pklocalauthority (and then more head scratching), I arrived at the
>> following alternative solution.
>>
>> Create a file in the directory /etc/polkit-1/localauthority/50-local.d/.
>> Ensure that the name of the file is unique and that it ends in .pkla. To
>> prevent shutdown and poweroff, and a stanza such as the following to the
>> file:
>>
>> * * * *[consolekit]
>> * * * *Identity=unix-user:*
>> * * * *Action=org.freedesktop.consolekit.system.*
>> * * * *ResultAny=no
>> * * * *ResultInactive=no
>> * * * *ResultActive=no
>>
>> To prevent suspend and hibernate, add this stanza:
>>
>> * * * *[upower]
>> * * * *Identity=unix-user:*
>> * * * *Action=org.freedesktop.upower.*
>> * * * *ResultAny=no
>> * * * *ResultInactive=no
>> * * * *ResultActive=no
>>
>> The result will be that the relevant options are removed from the System
>> menu in GNOME. They will still be present at the login screen, but will
>> be ignored.
>
> Doesn't that prevent anyone from shutting down, etc without su-ing to
> root in a terminal and doing so there?

Yes. My intention is to allow shutdown only by means of /sbin/poweroff
and friends.

>
> Wouldn't "ResultActive=auth_admin" be better? (IIUC, you'd have to
> supply the root password in order to shut down, etc.)

"Better" if that is the desired behaviour :-)

>
> I'd add "man polkit" to "man pklocalauthority" as *interesting* reading...
>
>


--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnip36c6.20h.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnip36c6.20h.liam.p.otoole@dipsy.tubbynet
 
Old 03-29-2011, 02:04 PM
Tom H
 
Default Prevent shutdown in Gnome

On Tue, Mar 29, 2011 at 4:34 AM, Liam O'Toole <liam.p.otoole@gmail.com> wrote:
> On 2011-03-29, Tom H <tomh0665@gmail.com> wrote:
>>
>> Wouldn't "ResultActive=auth_admin" be better? (IIUC, you'd have to
>> supply the root password in order to shut down, etc.)
>
> "Better" if that is the desired behaviour :-)

OK. I was thinking "simpler for admin."


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=918OtJYLSU1pU1XYEOWJROeYHqK-+S5qb02yx@mail.gmail.com">http://lists.debian.org/AANLkTi=918OtJYLSU1pU1XYEOWJROeYHqK-+S5qb02yx@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 08:36 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org