Fix The Shutdown/Reboot Issue With Multiple Users on Ubuntu

March 24, 2012 by
Filed under: HowTo, linux, Ubuntu 

A while back I purchased a nice LG Smart TV for my living room. Besides having the standard Smart TV applications like internet browsing and NetFlix, my TV can stream media from my PC either through a DLNA server or through LG's Media Link. In order to use the Media Link, you must install the Plex Media Server on your computer.

After installing Plex on my Ubuntu Lucid computer, I had an issue where I'd get a pop-up message when going to reboot or shutdown saying that the administrator password was required in order to shut down with multiple users logged in.  This is because the Plex Media Server installation creates a user called plex and the server is run under that ID. So the system saw that as another user logged in to the machine in  addition to me.

Well, thanks to a post on the Ubuntu Forums, I found a solution. You need to make a few edits to /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy so that you can reboot or shut down with multiple users logged in.

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

You can replace vim in the above command with your favorite text editor (ie. gedit, kate, mousepad, etc). The edits I had to make are show in bold below.

Affiliate Link

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">

<!--
Policy definitions for ConsoleKit
-->

<policyconfig>

  <action id="org.freedesktop.consolekit.system.stop">
    <description>Stop the system</description>
    <message>System policy prevents stopping the system</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.stop-multiple-users">
    <description>Stop the system when multiple users are logged in</description>
    <message>System policy prevents stopping the system when other users are logged in</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <!--File edited to fix shutdown issue after installing Plex Media Server.-->
      <!-- <allow_active>auth_admin_keep</allow_active> -->
      <allow_active>yes</allow_active>
      <!--End Edit-->
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.restart">
    <description>Restart the system</description>
    <message>System policy prevents restarting the system</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

  <action id="org.freedesktop.consolekit.system.restart-multiple-users">
    <description>Restart the system when multiple users are logged in</description>
    <message>System policy prevents restarting the system when other users are logged in</message>
    <defaults>
      <allow_inactive>no</allow_inactive>
      <!--File edited to fix reboot issue after installing Plex Media Server.-->
      <!-- <allow_active>auth_admin_keep</allow_active> -->
      <allow_active>yes</allow_active>
      <!--End Edit-->
    </defaults>
  </action>

</policyconfig>

I haven't had the above issue with a recent install of Kubuntu 11.10, but it does appear that it's affecting users of Ubuntu 11.10.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>