You are not logged in.
I searched online how to get rid of the Suspend and Hibernate options from the shut down menu, and found the following instructions:
There are two sections in this file:
/usr/share/polkit-1/actions/org.freedesktop.upower.policy
the first for suspend and the second for hibernate.
Near the end of each section will be a line with:
<allow_active>yes</allow_active>
It should be changed from “yes” to “no” to disable hibernate/suspend.
Can someone here verify if this is a correct way to do this? Or, if there is a more correct way to do it?
Last edited by Ron (2018-05-13 23:26:44)
Offline
So I went ahead and edited this file. I still get suspend in the shut down menu, and sometimes hibernate. So this "fix" isn't really a fix at all. Is there any other way?
P.S. I always got suspend, and sometimes hibernate even before I edited this file. Why would I sometimes get hibernate, and sometimes not? Also, when I was running Jessie, neither one appeared on the shut down menu.
Offline
I never use either of them, so I'm not familiar with them very well. If memory serves me, I didn't include hibernate in the Jessie build, so that may have something to do with it.
This is just a guess, but you could try...
sudo apt-get remove --purge hibernate
...followed by...
sudo apt autoremove
...to remove uswsusp too.
Both hibernate and suspend rely on upower...but if you remove that, you'll probably lose your power manager too. Might wanna wait to see if someone else has better advice.
I have been Devuanated, and my practice in the art of Devuanism shall continue until my Devuanization is complete. Until then, I will strive to continue in my understanding of Devuanchology, Devuanprocity, and Devuanivity.
Veni, vidi, vici vdevuaned. I came, I saw, I Devuaned.
Offline
Hi Ron,
have a look at: https://dev1galaxy.org/viewtopic.php?id=2023, I think it will give you some interesting insight.
Rolfie
Online
have a look at: https://dev1galaxy.org/viewtopic.php?id=2023, I think it will give you some interesting insight.
Read that thread and followed GNUser's advice in installing lightdm and libpolkit-backend-1-0-elogind and libpolkit-gobject-1-0-elogind. I'm still getting suspend and hibernate in the shut down menu. Did I forget to do something else?
BTW, last night I removed hibernate & uswsusp as MiyoLinux wrote. Then I looked up upower in Synaptic to see what would happen if I deleted that also. It would have removed the Mate desktop as well! That doesn't seem right. And I still had suspend and hibernate in the shut down menu.
Also, this reminded me of another thing. In the Mate control center, I don't have any link to Power Management. I downloaded the mate-power-manager-common app, but still no dice. I do remember after installing it some kind of error message popped up which unfortunately I didn't write down.
I have a feeling that all of this is somehow related. Anyone have any advice?
Offline
To disable hibernate and shutdown, use the opposite setting as listed in my .pkla file. Got this from askUbuntu.com, you should be able to find a more detailled explantion there.
Rolfie
Online
I don't have a policykit-1 folder in /etc . . . but I do have a PolicyKit and a polkit-1 folder.
Also I'm not understanding something. In that other thread you stated you did not enable suspend or hibernate. That's what I want, so why would I use the opposite settings?
Offline
Sorry, guess I confused two settings: the pkla I used was for the lightdm panel, not for the entry in the system menu. It has no influence on the system menu. I got a specific problem with ASCII and the lighdm panel solved this way. Thanks for the hint to the wrong directory spec.
Nevertherless, a specific pkla file in the /etc/polkit-1/localauthority/50-local.d/ is most likely the right choice for attacking your problem. What I have learned from posts at askUbuntu.com, using this makes the configuration safe against updates of the general policies.
I would recommend to do a search in askUbuntu.com and maybe uniix.stackexchange.com, there are lots of threads about various ways how to modify settings for shutdown, reboot, hibernate and suspend.
Rolfie
Online
Thanks Rolfie for the suggestion to search askUbuntu. I found something there that seems to be working:
[Disable suspend (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable suspend (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable suspend when others are logged in (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend-multiple-sessions
ResultActive=no
ResultInactive=no
ResultAny=no
I put this where you suggested (/etc/polkit-1/localauthority/50-local.d) with your file name (enable-shutdown-reboot.pkla), and it seems to be working, even without a reboot. I will continue to monitor this throughout the day (with multiple reboots) and report back.
EDIT:
Didn't notice at first that this only dropped suspend from the shut down menu. So I went back and made this file look like this and that also removed hibernate:
[Disable suspend (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable suspend (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable suspend when others are logged in (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend-multiple-sessions
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable hibernate (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable hibernate (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable hibernate when others are logged in (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate-multiple-sessions
ResultActive=no
ResultInactive=no
ResultAny=no
Last edited by Ron (2018-05-13 18:26:35)
Offline
Still working so marked as SOLVED.
Offline
You may name the file the way you like. it has nothing to do with the function. I guess *.pkla is mandatory, the internal format too, the rest is to your disposition. I took your solution, split it up in two files called disable-suspend.pkla and disable-hibernate.pkla. Works fine. No more suspend/hibernate in the shutdown dialogue. Choose a name that makes some sense for you.
Good luck, rolfie
Online