Начиная с Wheezy, в Debian (по крайней мере при использовании XFCE4 и Thunar) возникла одна проблема. При установке в качестве дисплейного менеджера чего-либо кроме GDM и KDM (например XDM или SLIM), перестали автоматом монтироваться USB Flash, да и выключение/перезагрузка из главного меню XFCE тоже не активны (прав нету). Хотя sudo mount и sudo shutdown работают как часы.
Как пишут в интернете, произошло сие прискорбное событие из-за того, что разработчики начали использовать связку из ConsoleKit и PolicyKit. И если разрабы KDM и GDM изменили свои менеджеры соответствующим образом, то господа, занимающиеся XDM, поленились это сделать.
Нет, можно поставить и KDM/GDM, но ведь они в Debian'e тянут за собой дикое количество зачастую малополезных библиотек и тому подобного "мусора". Ещё можно поиграться с правами на shutdown и mount (через sudo, естественно), написать своё меню, сделать свой скрипт для монтирования и т.д. Но изобретать велосипед, если честно, было неохота и просто лень, так что пришлось залезть во всезнающий Google и чуть менее всезнающий Яndex. Перекопав там кучу ссылок, я пришёл к описанному ниже рецепту.
Сразу скажу что, возможно, первые пункты ни на что не влияют, но у меня они уже были сделаны, а удалять их и проверять опять же лень. (Вот надо будет настроить так ещё один комп, тогда и проверю.)
Вначале приведу ссылки, которыми я пользовался.
1. Список рассылки с сайта derkeiler.com
Здесь лежит основная часть решения, и поблагодарить за неё стоит некоего товарища с ником Brian.
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 05:53:10 -0400
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
A related problem is that I am not able to restart or shut down using
the graphical tools; here's a recent discussion of this on the XFCE
forum from a Debian Testing user:
http://forum.xfce.org/viewtopic.php?id=6343 This also seems to depend on
a ConsoleKit permissions issue. I don't particularly care about this
myself, as it's easy enough to do this from the commandline; I'm
mentioning it only as a parallel.
I'd be grateful for any suggestions. This does seriously affect the
usability of the system, and it's getting very frustrating; I'd think
that the ability of a regular user to hotplug removable media should be
an important thing to have working.
Thanks.
From: Brian
Date: Wed, 12 Oct 2011 12:20:27 +0100
On Wed 12 Oct 2011 at 05:53:10 -0400, Jesse Sheidlower wrote:
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
The root cause is indeed consolekit. Have a try with this:
In /etc/pam.d/common-session insert the line
session optional pam_loginuid.co
just before
session optional pam_ck_connector.so nox11
Log out and log in again. Or reboot. This works on my machines (and
should solve your restart/shut down problem also) but there is a plan B
if needed.
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 08:10:09 -0400
On Wed, Oct 12, 2011 at 12:20:27PM +0100, Brian wrote:
On Wed 12 Oct 2011 at 05:53:10 -0400, Jesse Sheidlower wrote:
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
The root cause is indeed consolekit. Have a try with this:
In /etc/pam.d/common-session insert the line
session optional pam_loginuid.co
(I assume this was meant to be "pam_loginuid.so")
just before
session optional pam_ck_connector.so nox11
Log out and log in again. Or reboot. This works on my machines (and
should solve your restart/shut down problem also) but there is a plan B
if needed.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Thanks.
From: Brian
Date: Wed, 12 Oct 2011 13:51:15 +0100
On Wed 12 Oct 2011 at 08:10:09 -0400, Jesse Sheidlower wrote:
(I assume this was meant to be "pam_loginuid.so")
Yes.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Create /etc/polkit-1/localauthority/50-local.d/consolekit.pkla with the
contents:
[restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
[stop]
Identity=unix-user:brian
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
In the same directory have udisks.pkla containing:
[udisks]
Identity=unix-user:*
Action=org.freedesktop.udisks*
ResultAny=yes
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 22:09:53 -0400
On Wed, Oct 12, 2011 at 01:51:15PM +0100, Brian wrote:
On Wed 12 Oct 2011 at 08:10:09 -0400, Jesse Sheidlower wrote:
(I assume this was meant to be "pam_loginuid.so")
Yes.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Create /etc/polkit-1/localauthority/50-local.d/consolekit.pkla with the
contents:
[restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
[stop]
Identity=unix-user:brian
Took me a bit to figure out why "restart" worked by "shutdown" didn't,
until I realized that I'm not "brian"...
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
In the same directory have udisks.pkla containing:
[udisks]
Identity=unix-user:*
Action=org.freedesktop.udisks*
ResultAny=yes
OK, this works. Whew. Thank you _very_ much indeed.
What is the overall view of this issue? Is this a bug? Is your solution
the right one? Should it be fed back to the XFCE team? From my
perspective, this should Just Work, and the user shouldn't be expected
to figure out a solution like this....
Really, thanks.
2. ArchLinux Wiki раздел про запуск XFCE.
Ну а теперь само решение:
Вот мы на исходной: XFCE (или какой-нибудь WM) стоит, установлен Thunar (конечно же вместе с пакетом thunar-volman), а в качестве DM стоит XDM (или DM вообще не стоит, а запуск X'ов осуществляется старым добрым startx).
XFCE (WM) запущен, запущен Thunar в режиме демона (и настроен на автомонтирование), втыкаем флешку, а нам говорят: "Mount Failed: Failed to mount "[device]" Not Authorized" Мол, обломись --- прав у тебя нету.
В этом случае делаем так:
1. Прописываем как запускать WM:
Для этого создаём файл ~/.xinitrc с содержимым:
Делаем его исполняемым:
2. Прописываем загрузку библиотеки:
В файл /etc/pam.d/common-session перед строкой
вставляем строку
3. Прописываем права:
Создаём файл /etc/polkit-1/localauthority/50-local.d/consolekit.pkla с содержимым (вместо username вписываем своё имя пользователя или *):
Создаём файл /etc/polkit-1/localauthority/50-local.d/udisks.pkla с содержимым:
4. Перезагружаемся.
Вот и всё. Теперь у нас работает и автомонтирование флешек и выключение/перезагрузка из главного меню XFCE.
Как пишут в интернете, произошло сие прискорбное событие из-за того, что разработчики начали использовать связку из ConsoleKit и PolicyKit. И если разрабы KDM и GDM изменили свои менеджеры соответствующим образом, то господа, занимающиеся XDM, поленились это сделать.
Нет, можно поставить и KDM/GDM, но ведь они в Debian'e тянут за собой дикое количество зачастую малополезных библиотек и тому подобного "мусора". Ещё можно поиграться с правами на shutdown и mount (через sudo, естественно), написать своё меню, сделать свой скрипт для монтирования и т.д. Но изобретать велосипед, если честно, было неохота и просто лень, так что пришлось залезть во всезнающий Google и чуть менее всезнающий Яndex. Перекопав там кучу ссылок, я пришёл к описанному ниже рецепту.
Сразу скажу что, возможно, первые пункты ни на что не влияют, но у меня они уже были сделаны, а удалять их и проверять опять же лень. (Вот надо будет настроить так ещё один комп, тогда и проверю.)
Вначале приведу ссылки, которыми я пользовался.
1. Список рассылки с сайта derkeiler.com
Здесь лежит основная часть решения, и поблагодарить за неё стоит некоего товарища с ником Brian.
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 05:53:10 -0400
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
A related problem is that I am not able to restart or shut down using
the graphical tools; here's a recent discussion of this on the XFCE
forum from a Debian Testing user:
http://forum.xfce.org/viewtopic.php?id=6343 This also seems to depend on
a ConsoleKit permissions issue. I don't particularly care about this
myself, as it's easy enough to do this from the commandline; I'm
mentioning it only as a parallel.
I'd be grateful for any suggestions. This does seriously affect the
usability of the system, and it's getting very frustrating; I'd think
that the ability of a regular user to hotplug removable media should be
an important thing to have working.
Thanks.
From: Brian
Date: Wed, 12 Oct 2011 12:20:27 +0100
On Wed 12 Oct 2011 at 05:53:10 -0400, Jesse Sheidlower wrote:
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
The root cause is indeed consolekit. Have a try with this:
In /etc/pam.d/common-session insert the line
session optional pam_loginuid.co
just before
session optional pam_ck_connector.so nox11
Log out and log in again. Or reboot. This works on my machines (and
should solve your restart/shut down problem also) but there is a plan B
if needed.
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 08:10:09 -0400
On Wed, Oct 12, 2011 at 12:20:27PM +0100, Brian wrote:
On Wed 12 Oct 2011 at 05:53:10 -0400, Jesse Sheidlower wrote:
I'm running XFCE 4.8 on Debian Testing, with everything up to date; I'm
using xdm as my display manager. Any attempt by a non-root user to mount
a USB device in Thunar fails with the message "Mount Failed: Failed to
mount "[device]" Not Authorized". I do have Thunar set to mount
removable media automatically.
This seems to have been a problem from the start of 4.8; there's quite a
bit of discussion of this for Arch Linux and Slackware, but I can't find
anything useful for Debian. It seems to be an issue with ConsoleKit, but
the solutions for Arch don't really apply for Debian as the setup is
different. There was a discussion of this in the Debian forum when 4.8
came out at http://forums.debian.net/viewtopic.php?f=20&t=63088&start=60
but there was no clean answer.
The root cause is indeed consolekit. Have a try with this:
In /etc/pam.d/common-session insert the line
session optional pam_loginuid.co
(I assume this was meant to be "pam_loginuid.so")
just before
session optional pam_ck_connector.so nox11
Log out and log in again. Or reboot. This works on my machines (and
should solve your restart/shut down problem also) but there is a plan B
if needed.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Thanks.
From: Brian
Date: Wed, 12 Oct 2011 13:51:15 +0100
On Wed 12 Oct 2011 at 08:10:09 -0400, Jesse Sheidlower wrote:
(I assume this was meant to be "pam_loginuid.so")
Yes.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Create /etc/polkit-1/localauthority/50-local.d/consolekit.pkla with the
contents:
[restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
[stop]
Identity=unix-user:brian
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
In the same directory have udisks.pkla containing:
[udisks]
Identity=unix-user:*
Action=org.freedesktop.udisks*
ResultAny=yes
From: Jesse Sheidlower
Date: Wed, 12 Oct 2011 22:09:53 -0400
On Wed, Oct 12, 2011 at 01:51:15PM +0100, Brian wrote:
On Wed 12 Oct 2011 at 08:10:09 -0400, Jesse Sheidlower wrote:
(I assume this was meant to be "pam_loginuid.so")
Yes.
I'm afraid I need Plan B. Making this change and rebooting had no effect
on USB-device mounting or on the restart/shutdown display.
Create /etc/polkit-1/localauthority/50-local.d/consolekit.pkla with the
contents:
[restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
[stop]
Identity=unix-user:brian
Took me a bit to figure out why "restart" worked by "shutdown" didn't,
until I realized that I'm not "brian"...
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
In the same directory have udisks.pkla containing:
[udisks]
Identity=unix-user:*
Action=org.freedesktop.udisks*
ResultAny=yes
OK, this works. Whew. Thank you _very_ much indeed.
What is the overall view of this issue? Is this a bug? Is your solution
the right one? Should it be fed back to the XFCE team? From my
perspective, this should Just Work, and the user shouldn't be expected
to figure out a solution like this....
Really, thanks.
2. ArchLinux Wiki раздел про запуск XFCE.
Ну а теперь само решение:
Вот мы на исходной: XFCE (или какой-нибудь WM) стоит, установлен Thunar (конечно же вместе с пакетом thunar-volman), а в качестве DM стоит XDM (или DM вообще не стоит, а запуск X'ов осуществляется старым добрым startx).
XFCE (WM) запущен, запущен Thunar в режиме демона (и настроен на автомонтирование), втыкаем флешку, а нам говорят: "Mount Failed: Failed to mount "[device]" Not Authorized" Мол, обломись --- прав у тебя нету.
В этом случае делаем так:
1. Прописываем как запускать WM:
Для этого создаём файл ~/.xinitrc с содержимым:
#!/bin/bash
exec ck-launch-session startxfce4
Делаем его исполняемым:
$ chmod u+x ~/.xinitrc
2. Прописываем загрузку библиотеки:
В файл /etc/pam.d/common-session перед строкой
session optional pam_ck_connector.so nox11
вставляем строку
session optional pam_loginuid.so
3. Прописываем права:
Создаём файл /etc/polkit-1/localauthority/50-local.d/consolekit.pkla с содержимым (вместо username вписываем своё имя пользователя или *):
[restart]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
[stop]
Identity=unix-user:username
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
Создаём файл /etc/polkit-1/localauthority/50-local.d/udisks.pkla с содержимым:
[udisks]
Identity=unix-user:*
Action=org.freedesktop.udisks*
ResultAny=yes
4. Перезагружаемся.
Вот и всё. Теперь у нас работает и автомонтирование флешек и выключение/перезагрузка из главного меню XFCE.