* [gentoo-user] USB automount
@ 2012-09-10 22:56 Chris Stankevitz
2012-09-11 5:03 ` Walter Dnes
0 siblings, 1 reply; 38+ messages in thread
From: Chris Stankevitz @ 2012-09-10 22:56 UTC (permalink / raw
To: gentoo-user
Hello,
Can someone refer me to a source that explains how when I plug in a
USB "thumb drive" it appears on my XFCE4 desktop (or any other WM)?
Ideally the answer will use words like:
daemon
hal
udev
policykit
consolekit
/etc/init.d/*
hotplug
gvfs
mount
automount
pmount
gnome-volume-manager
udisks
fstab
mtab
Also, ideally after I know about it I'd like to be able to
"understand" and derive on my own the answer to this question: "is it
possible for TWM to recognize when I plug in a USB thumbdrive and
display it for me to use."
Thank you!
Chris
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-10 22:56 [gentoo-user] USB automount Chris Stankevitz
@ 2012-09-11 5:03 ` Walter Dnes
2012-09-11 8:56 ` Philip Webb
2012-09-11 15:30 ` [gentoo-user] " Chris Stankevitz
0 siblings, 2 replies; 38+ messages in thread
From: Walter Dnes @ 2012-09-11 5:03 UTC (permalink / raw
To: gentoo-user
On Mon, Sep 10, 2012 at 03:56:20PM -0700, Chris Stankevitz wrote
> Also, ideally after I know about it I'd like to be able to
> "understand" and derive on my own the answer to this question:
> "is it possible for TWM to recognize when I plug in a USB thumbdrive
> and display it for me to use."
A GUI is not necessary. TWM by itself is not only not enough, it's
not relevant. Every time that a USB device is inserted or removed, an
"event" is triggered by the kernel. What's required is an "event
handler" that reacts appropriately to those events. This is usually
udev, but mdev will also work. I've replaced udev with mdev on my
machine ( see https://wiki.gentoo.org/wiki/Mdev ) and I've implemented
USB automounting under mdev, using scripts. It works even in text
console mode. See https://wiki.gentoo.org/wiki/Mdev/Automount_USB
My approach may not be appropriate for a Gentoo newbie. In GNOME/KDE
etc, automounting is one of a ton of extra goodies in "the kitchen sink"
and it "just works". My approach requires doing some manual setting up
before it works. However, if you want an idea of the mechanics involved
my USB automount page provides the background... because I had to ask a
question similar to yours, and spend a few weeks searching for answers
on the web. It helps that I'm retired, and have the necessary time.
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 5:03 ` Walter Dnes
@ 2012-09-11 8:56 ` Philip Webb
2012-09-11 9:41 ` Neil Bothwick
2012-09-11 10:18 ` [gentoo-user] " Nikos Chantziaras
2012-09-11 15:30 ` [gentoo-user] " Chris Stankevitz
1 sibling, 2 replies; 38+ messages in thread
From: Philip Webb @ 2012-09-11 8:56 UTC (permalink / raw
To: gentoo-user
120911 Walter Dnes wrote:
> On Mon, Sep 10, 2012 Chris Stankevitz asked how to automount a USB stick :
> A GUI is not necessary. Every time a USB device is inserted or removed,
> an "event" is triggered by the kernel. What's required is
> an "event handler" that reacts appropriately to those events.
> This is usually udev, but mdev will also work.
> See https://wiki.gentoo.org/wiki/Mdev/Automount_USB
Why do people want to automount these sticks ?
I goto the root console which is always open on one of my desktops
& enter 'musb', which is a Bash alias for a 'mount' command;
when I've finished, I enter 'uusb' & wait for the prompt to come back,
which shows the stick has been successfully dismounted;
I can check its status via 'df' whenever I want.
I rarely want to use > 1 stick at the same time,
but it wb easy to create several aliases for different dev-mnt pairs.
--
========================,,============================================
SUPPORT ___________//___, Philip Webb
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
TRANSIT `-O----------O---' purslowatchassdotutorontodotca
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 8:56 ` Philip Webb
@ 2012-09-11 9:41 ` Neil Bothwick
2012-09-11 21:55 ` Walter Dnes
2012-09-11 10:18 ` [gentoo-user] " Nikos Chantziaras
1 sibling, 1 reply; 38+ messages in thread
From: Neil Bothwick @ 2012-09-11 9:41 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
On Tue, 11 Sep 2012 04:56:21 -0400, Philip Webb wrote:
> Why do people want to automount these sticks ?
Because it is easy and convenient, something computers are supposed to be
good for.
> I goto the root console which is always open on one of my desktops
> & enter 'musb', which is a Bash alias for a 'mount' command;
Leaving aside the implications of leaving open a root console, that
mounts the stick as root. That's fine for a FAT filesystem as you can
specify mount options to make it world-readable, but what about an
external drive formatted with ext? What about an external drive with
multiple partitions?
--
Neil Bothwick
X-Modem- A device on the losing end of an encounter with lightning.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* [gentoo-user] Re: USB automount
2012-09-11 8:56 ` Philip Webb
2012-09-11 9:41 ` Neil Bothwick
@ 2012-09-11 10:18 ` Nikos Chantziaras
1 sibling, 0 replies; 38+ messages in thread
From: Nikos Chantziaras @ 2012-09-11 10:18 UTC (permalink / raw
To: gentoo-user
On 11/09/12 11:56, Philip Webb wrote:
> 120911 Walter Dnes wrote:
>> On Mon, Sep 10, 2012 Chris Stankevitz asked how to automount a USB stick :
>> A GUI is not necessary. Every time a USB device is inserted or removed,
>> an "event" is triggered by the kernel. What's required is
>> an "event handler" that reacts appropriately to those events.
>> This is usually udev, but mdev will also work.
>> See https://wiki.gentoo.org/wiki/Mdev/Automount_USB
>
> Why do people want to automount these sticks ?
Because 99.9% of the time, the sole reason you plugged them in is to
mount them rather than just watch its LED light up :-P There's no
reason not to mount them.
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 5:03 ` Walter Dnes
2012-09-11 8:56 ` Philip Webb
@ 2012-09-11 15:30 ` Chris Stankevitz
2012-09-11 16:43 ` Canek Peláez Valdés
1 sibling, 1 reply; 38+ messages in thread
From: Chris Stankevitz @ 2012-09-11 15:30 UTC (permalink / raw
To: gentoo-user
On Mon, Sep 10, 2012 at 10:03 PM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> Every time that a USB device is inserted or removed, an
> "event" is triggered by the kernel. What's required is an "event
> handler" that reacts appropriately to those events. This is usually
> udev, but mdev will also work. I've replaced udev with mdev on my
> machine ( see https://wiki.gentoo.org/wiki/Mdev ) and I've implemented
> USB automounting under mdev, using scripts. It works even in text
> console mode. See https://wiki.gentoo.org/wiki/Mdev/Automount_USB
Walter,
Thank you. What I'm hearing is:
1. There are many ways to get USB automount
2. One way is to install udev and fabricate the correct scripting to
cause the automount to take place
3. By some magic a GUI system such as GNOME, XFCE, TWM, etc will
recognize when (2) happens and show an icon on the desktop [I'm
talking somewhat tongue in cheek WRT TWM]
If this is correct, I'd like to know:
a) what is the scripting I need to fabricate to get (2) to work correctly.
b) what is the magic by which (3) happens.
Thank you,
Chris
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 15:30 ` [gentoo-user] " Chris Stankevitz
@ 2012-09-11 16:43 ` Canek Peláez Valdés
0 siblings, 0 replies; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-11 16:43 UTC (permalink / raw
To: gentoo-user
On Tue, Sep 11, 2012 at 10:30 AM, Chris Stankevitz
<chrisstankevitz@gmail.com> wrote:
> On Mon, Sep 10, 2012 at 10:03 PM, Walter Dnes <waltdnes@waltdnes.org> wrote:
>> Every time that a USB device is inserted or removed, an
>> "event" is triggered by the kernel. What's required is an "event
>> handler" that reacts appropriately to those events. This is usually
>> udev, but mdev will also work. I've replaced udev with mdev on my
>> machine ( see https://wiki.gentoo.org/wiki/Mdev ) and I've implemented
>> USB automounting under mdev, using scripts. It works even in text
>> console mode. See https://wiki.gentoo.org/wiki/Mdev/Automount_USB
>
> Walter,
>
> Thank you. What I'm hearing is:
>
> 1. There are many ways to get USB automount
Correct.
> 2. One way is to install udev and fabricate the correct scripting to
> cause the automount to take place
That it's the "I want to do it by hand" way.
> 3. By some magic a GUI system such as GNOME, XFCE, TWM, etc will
> recognize when (2) happens and show an icon on the desktop [I'm
> talking somewhat tongue in cheek WRT TWM]
That is the automagical™ way.
> If this is correct, I'd like to know:
>
> a) what is the scripting I need to fabricate to get (2) to work correctly.
I you want to do it by hand (which is as useful as trying to drive a
car as the Flinstones, i.e., with your own feet), you need to create
an udev rule. An old tutorial on that is:
http://www.reactivated.net/writing_udev_rules.html
It's a little outdated, since from some years ago it has been working
"out-of-the-box" in almost all Linux distros, specially if they
install and configure udev as intended by its upstream. So the need
for users to handle udev rules has been greatly reduced.
> b) what is the magic by which (3) happens.
It's not magic; just the modern desktop environments install a program
(or programs) that installs udev rules, and that handle things like
the pretty icons (or notifications, or whatever). In GNOME 3 case, the
program is udisks (version 2), which installs:
/usr/lib/udev/rules.d/80-udisks2.rules
Then it handles everything for you. Please also note that USB stick
mounting is just *ONE* of the gazillion things udev (and other parts
of the stack) takes care of. For example, in this screenshot:
https://plus.google.com/115256116066287398549/posts/JX6kRciZ9zA
I'm configuring Skype to use my bluetooth head set for input/output of
sound, while the rest of my system keeps using the desktop sound card.
The whole shebang is powered by udev (for detecting the headset as
source/sink for audio), bluez (for pairing it), pulseaudio (for
switching sound streams on the fly), etc. You can (of course) do all
of this by hand, but it gets pretty convoluted after a while.
Mounting USB sticks is easy; as Philip said, you can do it with
"mount" in a terminal as root (for example). It could be argued about
how smart is to do it, but it's easy alright.
I care more about stuff like the above screenshot; I could argue that
it's easier (or at least not as difficult) to set up a BT headset for
use with Skype on the fly on Linux than on Mac OS X or Windows. For
that level of easiness and automagicality™, you need the whole stack
working correctly.
It is nice to learn how to do all of that by hand; if you have the
time (and the interest) is a nice thing to do. For doing real work,
it's not very useful.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 9:41 ` Neil Bothwick
@ 2012-09-11 21:55 ` Walter Dnes
2012-09-11 22:42 ` Michael Mol
2012-09-11 22:51 ` Neil Bothwick
0 siblings, 2 replies; 38+ messages in thread
From: Walter Dnes @ 2012-09-11 21:55 UTC (permalink / raw
To: gentoo-user
On Tue, Sep 11, 2012 at 10:41:22AM +0100, Neil Bothwick wrote
> > I goto the root console which is always open on one of my desktops
> > & enter 'musb', which is a Bash alias for a 'mount' command;
>
> Leaving aside the implications of leaving open a root console,
My scripts use pmount and pumount, which are hard-coded to only
mount/unmount devices in directory /media.
> that mounts the stick as root. That's fine for a FAT filesystem as
> you can specify mount options to make it world-readable, but what
> about an external drive formatted with ext? What about an external
> drive with multiple partitions?
pmount/pumount to the rescue. See...
http://manpages.ubuntu.com/manpages/natty/man1/pmount.1.html
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 21:55 ` Walter Dnes
@ 2012-09-11 22:42 ` Michael Mol
2012-09-11 22:51 ` Neil Bothwick
1 sibling, 0 replies; 38+ messages in thread
From: Michael Mol @ 2012-09-11 22:42 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 977 bytes --]
On Tue, Sep 11, 2012 at 5:55 PM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> On Tue, Sep 11, 2012 at 10:41:22AM +0100, Neil Bothwick wrote
>
> > > I goto the root console which is always open on one of my desktops
> > > & enter 'musb', which is a Bash alias for a 'mount' command;
> >
> > Leaving aside the implications of leaving open a root console,
>
> My scripts use pmount and pumount, which are hard-coded to only
> mount/unmount devices in directory /media.
>
> > that mounts the stick as root. That's fine for a FAT filesystem as
> > you can specify mount options to make it world-readable, but what
> > about an external drive formatted with ext? What about an external
> > drive with multiple partitions?
>
> pmount/pumount to the rescue. See...
> http://manpages.ubuntu.com/manpages/natty/man1/pmount.1.html
>
>
I didn't know about that. That's...awesome. And it'll save me trouble.
This is why I like this list; I learn stuff just by listening in.
--
:wq
[-- Attachment #2: Type: text/html, Size: 1595 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 21:55 ` Walter Dnes
2012-09-11 22:42 ` Michael Mol
@ 2012-09-11 22:51 ` Neil Bothwick
2012-09-12 2:47 ` Walter Dnes
2012-09-12 11:11 ` Philip Webb
1 sibling, 2 replies; 38+ messages in thread
From: Neil Bothwick @ 2012-09-11 22:51 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
On Tue, 11 Sep 2012 17:55:41 -0400, Walter Dnes wrote:
> > > I goto the root console which is always open on one of my desktops
> > > & enter 'musb', which is a Bash alias for a 'mount' command;
> >
> > Leaving aside the implications of leaving open a root console,
>
> My scripts use pmount and pumount, which are hard-coded to only
> mount/unmount devices in directory /media.
It's the idea of leaving a root console open for all to access that is
the issue, not the commands you run in it.
> > that mounts the stick as root. That's fine for a FAT filesystem as
> > you can specify mount options to make it world-readable, but what
> > about an external drive formatted with ext? What about an external
> > drive with multiple partitions?
>
> pmount/pumount to the rescue. See...
> http://manpages.ubuntu.com/manpages/natty/man1/pmount.1.html
I know about pmount, I use it myself. It mounts as the user running it,
which is fine from a (non-root) terminal, but udevd is running as root,
as are any programs it runs.
--
Neil Bothwick
Top Oxymorons Number 40: Same difference
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 22:51 ` Neil Bothwick
@ 2012-09-12 2:47 ` Walter Dnes
2012-09-12 8:03 ` Neil Bothwick
2012-09-12 11:11 ` Philip Webb
1 sibling, 1 reply; 38+ messages in thread
From: Walter Dnes @ 2012-09-12 2:47 UTC (permalink / raw
To: gentoo-user
On Tue, Sep 11, 2012 at 11:51:30PM +0100, Neil Bothwick wrote
> It's the idea of leaving a root console open for all to access that is
> the issue, not the commands you run in it.
Fully agree that's a bad idea. My system uses sudoers. I.e. in
/etc/sudoers.d/001 I have the lines...
user2 d531 = (root) NOPASSWD: /usr/local/bin/ux *
waltdnes d531 = (root) NOPASSWD: /usr/local/bin/ux *
...where /usr/local/bin/ux consists of...
#!/bin/busybox ash
pumount ${1}
...and in my home directory I have ~/bin/um which consists of...
#! /bin/busybox ash
sudo /usr/local/bin/ux ${1}
...So I can, as a regular user, execute at the commandline...
um sdb1
...and /media/sdb1 is unmounted. No need to log on as root or have a
root shell.
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-12 2:47 ` Walter Dnes
@ 2012-09-12 8:03 ` Neil Bothwick
2012-09-13 6:50 ` Walter Dnes
0 siblings, 1 reply; 38+ messages in thread
From: Neil Bothwick @ 2012-09-12 8:03 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]
On Tue, 11 Sep 2012 22:47:21 -0400, Walter Dnes wrote:
> Fully agree that's a bad idea. My system uses sudoers. I.e. in
> /etc/sudoers.d/001 I have the lines...
>
> user2 d531 = (root) NOPASSWD: /usr/local/bin/ux *
> waltdnes d531 = (root) NOPASSWD: /usr/local/bin/ux *
>
> ...where /usr/local/bin/ux consists of...
>
> #!/bin/busybox ash
> pumount ${1}
>
> ...and in my home directory I have ~/bin/um which consists of...
>
> #! /bin/busybox ash
> sudo /usr/local/bin/ux ${1}
>
> ...So I can, as a regular user, execute at the commandline...
>
> um sdb1
>
> ...and /media/sdb1 is unmounted. No need to log on as root or have a
> root shell.
I don't understand, why are you using sudo to run pmount when its core
purpose is to be run by normal users?
% whatis pmount
pmount (1) - mount arbitrary hotpluggable devices as normal user
--
Neil Bothwick
Life's a cache, and then you flush...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-11 22:51 ` Neil Bothwick
2012-09-12 2:47 ` Walter Dnes
@ 2012-09-12 11:11 ` Philip Webb
1 sibling, 0 replies; 38+ messages in thread
From: Philip Webb @ 2012-09-12 11:11 UTC (permalink / raw
To: gentoo-user
120911 Neil Bothwick was worried at the idea
of leaving a root console open for all to access:
My machine is not accessible to anyone else, so it's not a problem here.
Yes, it's not a good idea if you're in a data centre or open-plan office.
--
========================,,============================================
SUPPORT ___________//___, Philip Webb
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
TRANSIT `-O----------O---' purslowatchassdotutorontodotca
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-12 8:03 ` Neil Bothwick
@ 2012-09-13 6:50 ` Walter Dnes
2012-09-13 8:32 ` Neil Bothwick
2012-09-13 14:19 ` Canek Peláez Valdés
0 siblings, 2 replies; 38+ messages in thread
From: Walter Dnes @ 2012-09-13 6:50 UTC (permalink / raw
To: gentoo-user
On Wed, Sep 12, 2012 at 09:03:50AM +0100, Neil Bothwick wrote
> I don't understand, why are you using sudo to run pmount when its core
> purpose is to be run by normal users?
>
> % whatis pmount
> pmount (1) - mount arbitrary hotpluggable devices as normal user
A normal user can pumount *WHAT THAT SAME USER* has pmounted. Now try
for a general solution. If you're the only user on the system, it's
probably safe to keep an open xterm logged in to root. The problem is
that inserting a USB device sets off a kernel event, that is passed to
mdev, which looks for a script name in /etc/mdev.conf. If a script is
found that matches the device spec (i.e. sd[a-z].*), e.g. my automount
script, then the script is launched *AS ROOT*. Given that root has
mounted the device, only root can unmount it. E.g. when root pmounts a
device and normal user tries to pumount it, I get...
waltdnes@d531 ~ $ pumount sdb1
Error: device /dev/sdb1 was not mounted by you
Note also that the automount script has to first create a directory in
/media, before mounting it. Since /media is drwxr-xr-x the directory
has to be created by root, or else I have to open up /media to writing
and directory creation by all users. The most secure approach is to
have the system do things as root without user intervention, as much as
possible.
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 6:50 ` Walter Dnes
@ 2012-09-13 8:32 ` Neil Bothwick
2012-09-13 14:19 ` Canek Peláez Valdés
1 sibling, 0 replies; 38+ messages in thread
From: Neil Bothwick @ 2012-09-13 8:32 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
On Thu, 13 Sep 2012 02:50:27 -0400, Walter Dnes wrote:
> > I don't understand, why are you using sudo to run pmount when its core
> > purpose is to be run by normal users?
> >
> > % whatis pmount
> > pmount (1) - mount arbitrary hotpluggable devices as normal user
>
> A normal user can pumount *WHAT THAT SAME USER* has pmounted.
Ah, sorry. I didn't read your post carefully enough and saw pmount when
you were using pumount. Using sudo for that makes sense.
> Now try
> for a general solution. If you're the only user on the system, it's
> probably safe to keep an open xterm logged in to root. The problem is
> that inserting a USB device sets off a kernel event, that is passed to
> mdev, which looks for a script name in /etc/mdev.conf. If a script is
> found that matches the device spec (i.e. sd[a-z].*), e.g. my automount
> script, then the script is launched *AS ROOT*. Given that root has
> mounted the device, only root can unmount it.
It's exactly the same problem when udev is used to mount a device, which
is why I prefer to have a process running as the logged in user doing
that, whether it be something incorporated into the DE or a separate
daemon started from ~/.xinitrc.
It gets messy if you are running a multi-seat system, but if only one
user is running X at a time, it is the cleanest way. Of course, as you
are having mdev run a script, you could get that script to check which
user is logged into X and use su to mount it for them, avoiding the
umount issues.
--
Neil Bothwick
Like an atheist in a grave: all dressed up and no place to go.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 6:50 ` Walter Dnes
2012-09-13 8:32 ` Neil Bothwick
@ 2012-09-13 14:19 ` Canek Peláez Valdés
2012-09-13 14:42 ` Neil Bothwick
` (2 more replies)
1 sibling, 3 replies; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 14:19 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 1:50 AM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> On Wed, Sep 12, 2012 at 09:03:50AM +0100, Neil Bothwick wrote
>
>> I don't understand, why are you using sudo to run pmount when its core
>> purpose is to be run by normal users?
>>
>> % whatis pmount
>> pmount (1) - mount arbitrary hotpluggable devices as normal user
>
> A normal user can pumount *WHAT THAT SAME USER* has pmounted. Now try
> for a general solution.
The general solution is using something like udisks+polkit. That is a
true general solution; otherwise you end up like the author of
calibre, with a security mess on his hands:
https://bugs.launchpad.net/calibre/+bug/885027
If you dismiss the security implications of sudoing pmount, because
you care only about *your* use cases, on *your* machine, by definition
that is not a "general solution".
Of course, udisks/polkit/etc. goes hand in hand with udev, so you are
probably not interested in using them. That is completely fine.
Just don't call it a "general solution".
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 14:19 ` Canek Peláez Valdés
@ 2012-09-13 14:42 ` Neil Bothwick
2012-09-13 14:49 ` Canek Peláez Valdés
2012-09-13 16:21 ` Stefan G. Weichinger
2012-09-13 23:41 ` Walter Dnes
2 siblings, 1 reply; 38+ messages in thread
From: Neil Bothwick @ 2012-09-13 14:42 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 975 bytes --]
On Thu, 13 Sep 2012 09:19:19 -0500, Canek Peláez Valdés wrote:
> > A normal user can pumount *WHAT THAT SAME USER* has pmounted. Now
> > try for a general solution.
>
> The general solution is using something like udisks+polkit. That is a
> true general solution; otherwise you end up like the author of
> calibre, with a security mess on his hands:
>
> https://bugs.launchpad.net/calibre/+bug/885027
>
> If you dismiss the security implications of sudoing pmount, because
> you care only about *your* use cases, on *your* machine, by definition
> that is not a "general solution".
You should never need to sudo pmount, it is supposed to run as a normal
user. Walter is using sudo to run pumount, which is nothing like the
situation described in that bug. Even pmount avoids the situations
described in that bug because it is only capable of operating in /media.
--
Neil Bothwick
A man wrapped up in himself makes a very small package.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 14:42 ` Neil Bothwick
@ 2012-09-13 14:49 ` Canek Peláez Valdés
0 siblings, 0 replies; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 14:49 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 9:42 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Thu, 13 Sep 2012 09:19:19 -0500, Canek Peláez Valdés wrote:
>
>> > A normal user can pumount *WHAT THAT SAME USER* has pmounted. Now
>> > try for a general solution.
>>
>> The general solution is using something like udisks+polkit. That is a
>> true general solution; otherwise you end up like the author of
>> calibre, with a security mess on his hands:
>>
>> https://bugs.launchpad.net/calibre/+bug/885027
>>
>> If you dismiss the security implications of sudoing pmount, because
>> you care only about *your* use cases, on *your* machine, by definition
>> that is not a "general solution".
>
> You should never need to sudo pmount, it is supposed to run as a normal
> user. Walter is using sudo to run pumount, which is nothing like the
> situation described in that bug. Even pmount avoids the situations
> described in that bug because it is only capable of operating in /media.
OK, noted. It is still not "a general solution", which is my main point.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 14:19 ` Canek Peláez Valdés
2012-09-13 14:42 ` Neil Bothwick
@ 2012-09-13 16:21 ` Stefan G. Weichinger
2012-09-13 16:41 ` Canek Peláez Valdés
2012-09-13 23:41 ` Walter Dnes
2 siblings, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-13 16:21 UTC (permalink / raw
To: gentoo-user
Am 13.09.2012 16:19, schrieb Canek Peláez Valdés:
> The general solution is using something like udisks+polkit.
I have troubles with that combo for a month or so ... seems as if
polkit-0.107 somehow is responsible for stuff not mounted here.
~amd64 btw, gnome-3-context.
udisks comes (/is installed) in both slot 0 and 2, correct?
[I] sys-fs/udisks
Available versions:
(0) 1.0.4-r2 (~)1.0.4-r3
(2) (~)1.99.0 (~)1.99.0-r1
Does it work for all of you?
scratching my head ...
Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 16:21 ` Stefan G. Weichinger
@ 2012-09-13 16:41 ` Canek Peláez Valdés
2012-09-13 17:14 ` Stefan G. Weichinger
0 siblings, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 16:41 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 11:21 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 13.09.2012 16:19, schrieb Canek Peláez Valdés:
>
>> The general solution is using something like udisks+polkit.
>
> I have troubles with that combo for a month or so ... seems as if
> polkit-0.107 somehow is responsible for stuff not mounted here.
>
> ~amd64 btw, gnome-3-context.
>
> udisks comes (/is installed) in both slot 0 and 2, correct?
>
> [I] sys-fs/udisks
> Available versions:
> (0) 1.0.4-r2 (~)1.0.4-r3
> (2) (~)1.99.0 (~)1.99.0-r1
>
> Does it work for all of you?
It doesn't, but I was under the assumption it was because I'm using
systemd. Since I installed gnome-shell-3.4 this has stopped working;
my findings can be seen on the bug to freedesktop.org:
https://bugs.freedesktop.org/show_bug.cgi?id=53905
It hits not only USB mounting; it also hits suspend/hibernate (I'm no
longer allowed to suspend as user), setting up printers, and basically
everything related to polkit. The root of the problem seems to be that
(somehow) gnome-shell gets registered as PolitUnixSession instead of
PolkitUnixProcess or PolkitSystemBusName, and that case is not covered
in subject_to_jsval.
Could you run polkitd without the --no-debug option (I don't have
OpenRC installed, nor /etc/init.d, so I don't know if that is how it's
run under OpenRC) and see on the logs if you see the following?
**
ERROR:polkitbackendjsauthority.c:730:subject_to_jsval: code should not be
reached
If so, please state it in the bug. David hasn't answered in three
weeks; two of them he was at the Kernel Summit in San Diego, but I
think it's time for me to nudge him again. An independent report
should help.
I'm running GNOME 3 unstable and with my systemd-only overlay, so I'm
used to this kind of things happening from time to time. Also, it has
easy workarounds (pmount, pm-suspend, etc.), so I haven't been really
concerned into fixing it.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 16:41 ` Canek Peláez Valdés
@ 2012-09-13 17:14 ` Stefan G. Weichinger
2012-09-13 17:29 ` Canek Peláez Valdés
2012-09-13 17:31 ` Canek Peláez Valdés
0 siblings, 2 replies; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-13 17:14 UTC (permalink / raw
To: gentoo-user
Am 13.09.2012 18:41, schrieb Canek Peláez Valdés:
> It doesn't, but I was under the assumption it was because I'm using
> systemd. Since I installed gnome-shell-3.4 this has stopped working;
> my findings can be seen on the bug to freedesktop.org:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=53905
>
> It hits not only USB mounting; it also hits suspend/hibernate (I'm no
> longer allowed to suspend as user), setting up printers, and basically
> everything related to polkit.
correct! Same stuff here ... additionally accessing libvirt (if compiled
with polkit).
> Could you run polkitd without the --no-debug option (I don't have
> OpenRC installed, nor /etc/init.d, so I don't know if that is how it's
> run under OpenRC) and see on the logs if you see the following?
>
> **
> ERROR:polkitbackendjsauthority.c:730:subject_to_jsval: code should not be
> reached
I wonder how to start it without that option. When I have Gnome running
and kill the polkit, then restart it ... I see it running but the last
line is:
Acquired the name org.freedesktop.PolicyKit1 on the system bus
> If so, please state it in the bug. David hasn't answered in three
> weeks; two of them he was at the Kernel Summit in San Diego, but I
> think it's time for me to nudge him again. An independent report
> should help.
>
> I'm running GNOME 3 unstable and with my systemd-only overlay, so I'm
> used to this kind of things happening from time to time. Also, it has
> easy workarounds (pmount, pm-suspend, etc.), so I haven't been really
> concerned into fixing it.
I fixed it by downgrading polkit afai remember (weeks ago).
Gave the new ebuild a try and still these issues.
S
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:14 ` Stefan G. Weichinger
@ 2012-09-13 17:29 ` Canek Peláez Valdés
2012-09-13 17:48 ` Canek Peláez Valdés
2012-09-13 17:54 ` Stefan G. Weichinger
2012-09-13 17:31 ` Canek Peláez Valdés
1 sibling, 2 replies; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 17:29 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 12:14 PM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 13.09.2012 18:41, schrieb Canek Peláez Valdés:
>
>> It doesn't, but I was under the assumption it was because I'm using
>> systemd. Since I installed gnome-shell-3.4 this has stopped working;
>> my findings can be seen on the bug to freedesktop.org:
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=53905
>>
>> It hits not only USB mounting; it also hits suspend/hibernate (I'm no
>> longer allowed to suspend as user), setting up printers, and basically
>> everything related to polkit.
>
> correct! Same stuff here ... additionally accessing libvirt (if compiled
> with polkit).
>
>> Could you run polkitd without the --no-debug option (I don't have
>> OpenRC installed, nor /etc/init.d, so I don't know if that is how it's
>> run under OpenRC) and see on the logs if you see the following?
>>
>> **
>> ERROR:polkitbackendjsauthority.c:730:subject_to_jsval: code should not be
>> reached
>
> I wonder how to start it without that option. When I have Gnome running
> and kill the polkit, then restart it ... I see it running but the last
> line is:
>
> Acquired the name org.freedesktop.PolicyKit1 on the system bus
$ /usr/lib/polkit-1/polkitd --replace --no-debug
>> If so, please state it in the bug. David hasn't answered in three
>> weeks; two of them he was at the Kernel Summit in San Diego, but I
>> think it's time for me to nudge him again. An independent report
>> should help.
>>
>> I'm running GNOME 3 unstable and with my systemd-only overlay, so I'm
>> used to this kind of things happening from time to time. Also, it has
>> easy workarounds (pmount, pm-suspend, etc.), so I haven't been really
>> concerned into fixing it.
>
> I fixed it by downgrading polkit afai remember (weeks ago).
> Gave the new ebuild a try and still these issues.
I actually hadn't thought about downgrading polkit, since it was
working with the same version in GNOME 3.2. Or maybe it was a fluke
(the bug is reproducible, but sometimes I need to try several times).
I will try downgrading.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:14 ` Stefan G. Weichinger
2012-09-13 17:29 ` Canek Peláez Valdés
@ 2012-09-13 17:31 ` Canek Peláez Valdés
2012-09-13 17:55 ` Stefan G. Weichinger
1 sibling, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 17:31 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 12:14 PM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 13.09.2012 18:41, schrieb Canek Peláez Valdés:
>
>> It doesn't, but I was under the assumption it was because I'm using
>> systemd. Since I installed gnome-shell-3.4 this has stopped working;
>> my findings can be seen on the bug to freedesktop.org:
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=53905
>>
>> It hits not only USB mounting; it also hits suspend/hibernate (I'm no
>> longer allowed to suspend as user), setting up printers, and basically
>> everything related to polkit.
>
> correct! Same stuff here ... additionally accessing libvirt (if compiled
> with polkit).
Oh, BTW; I just run /usr/sbin/libvirtd --verbose as my user before
starting boxes; everything works. It also works invoking qemu by hand.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:29 ` Canek Peláez Valdés
@ 2012-09-13 17:48 ` Canek Peláez Valdés
2012-09-13 18:08 ` Stefan G. Weichinger
2012-09-13 17:54 ` Stefan G. Weichinger
1 sibling, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 17:48 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 12:29 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
[snip]
> I actually hadn't thought about downgrading polkit, since it was
> working with the same version in GNOME 3.2. Or maybe it was a fluke
> (the bug is reproducible, but sometimes I need to try several times).
> I will try downgrading.
Didn't work with 0.106-r7 (which I had to hunt from the Attic), and I
cannot downgrade to 0.104 since udisks:2 depends on it. So I suppose
we need to nudge David again.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:29 ` Canek Peláez Valdés
2012-09-13 17:48 ` Canek Peláez Valdés
@ 2012-09-13 17:54 ` Stefan G. Weichinger
1 sibling, 0 replies; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-13 17:54 UTC (permalink / raw
To: gentoo-user
Am 13.09.2012 19:29, schrieb Canek Peláez Valdés:
> $ /usr/lib/polkit-1/polkitd --replace --no-debug
I think you want debug ... so:
$ /usr/lib/polkit-1/polkitd --replace
right?
No additional output here, tried clicking user-menu (upper right) as
mentioned in your bug-report ...
>> I fixed it by downgrading polkit afai remember (weeks ago). Gave
>> the new ebuild a try and still these issues.
>
> I actually hadn't thought about downgrading polkit, since it was
> working with the same version in GNOME 3.2. Or maybe it was a fluke
> (the bug is reproducible, but sometimes I need to try several
> times). I will try downgrading.
I think it worked with the latest stable polkit.
Would have to retry, right now I have to leave my office ...
Thanks, Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:31 ` Canek Peláez Valdés
@ 2012-09-13 17:55 ` Stefan G. Weichinger
0 siblings, 0 replies; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-13 17:55 UTC (permalink / raw
To: gentoo-user
Am 13.09.2012 19:31, schrieb Canek Peláez Valdés:
> Oh, BTW; I just run /usr/sbin/libvirtd --verbose as my user before
> starting boxes; everything works. It also works invoking qemu by hand.
I rebuilt libvirt without the polkit-USE-flag. Standalone box for
myself, unix-auth is enough ... IMO.
S
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 17:48 ` Canek Peláez Valdés
@ 2012-09-13 18:08 ` Stefan G. Weichinger
2012-09-13 18:56 ` Canek Peláez Valdés
0 siblings, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-13 18:08 UTC (permalink / raw
To: gentoo-user
Am 13.09.2012 19:48, schrieb Canek Peláez Valdés:
> On Thu, Sep 13, 2012 at 12:29 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
> [snip]
>> I actually hadn't thought about downgrading polkit, since it was
>> working with the same version in GNOME 3.2. Or maybe it was a fluke
>> (the bug is reproducible, but sometimes I need to try several times).
>> I will try downgrading.
>
> Didn't work with 0.106-r7 (which I had to hunt from the Attic), and I
> cannot downgrade to 0.104 since udisks:2 depends on it. So I suppose
> we need to nudge David again.
Yes, that conflict sounds familiar ... I hit that one also!
S
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 18:08 ` Stefan G. Weichinger
@ 2012-09-13 18:56 ` Canek Peláez Valdés
2012-09-14 5:42 ` Stefan G. Weichinger
0 siblings, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-13 18:56 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 1:08 PM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 13.09.2012 19:48, schrieb Canek Peláez Valdés:
>> On Thu, Sep 13, 2012 at 12:29 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
>> [snip]
>>> I actually hadn't thought about downgrading polkit, since it was
>>> working with the same version in GNOME 3.2. Or maybe it was a fluke
>>> (the bug is reproducible, but sometimes I need to try several times).
>>> I will try downgrading.
>>
>> Didn't work with 0.106-r7 (which I had to hunt from the Attic), and I
>> cannot downgrade to 0.104 since udisks:2 depends on it. So I suppose
>> we need to nudge David again.
>
> Yes, that conflict sounds familiar ... I hit that one also!
I took another look at polkit's and gnome-shell's source code. I
didn't do it before since I have work to do and (as I said) the
problems are somewhat workaroundables. After looking at the code, the
plot thickens:
gnome-shell registers itself to polkit as a PolkitUnixSession:
http://git.gnome.org/browse/gnome-shell/tree/src/shell-polkit-authentication-agent.c?id=3.4.2#n106
polkit will not deal with that in subject_to_jsval:
http://cgit.freedesktop.org/polkit/tree/src/polkitbackend/polkitbackendjsauthority.c?id=0.107#n730
The funny thing? Both code paths were written by David Zeuthen, which
by the way is the one handling the bug.
It gets better: I changed gnome-shell's code so it registers itself as
PolkitUnixProcess (which supposedly is handled by subject_to_jsval),
and I put printf's in the function subject_to_jsval. It turns out
that, no matter that it actually gets registered as unix-process,
gnome-shell it's also registered (at some point) as unix-session.
My feeling is that gnome-shell should get registered as
system-bus-name (which it does), and that should be the "primary"
interface of gnome-shell for polkit. However, in Gentoo (I haven't
found any other mention of this bug in any other distro), somehow the
unix-session interface takes control.
I updated the bug:
https://bugs.freedesktop.org/show_bug.cgi?id=53905
and I hope David will respond soon.
Regards
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 14:19 ` Canek Peláez Valdés
2012-09-13 14:42 ` Neil Bothwick
2012-09-13 16:21 ` Stefan G. Weichinger
@ 2012-09-13 23:41 ` Walter Dnes
2 siblings, 0 replies; 38+ messages in thread
From: Walter Dnes @ 2012-09-13 23:41 UTC (permalink / raw
To: gentoo-user
On Thu, Sep 13, 2012 at 09:19:19AM -0500, Canek Pel??ez Vald??s wrote
> On Thu, Sep 13, 2012 at 1:50 AM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> > A normal user can pumount *WHAT THAT SAME USER* has pmounted. Now try
> > for a general solution.
>
> The general solution is using something like udisks+polkit. That is a
> true general solution; otherwise you end up like the author of
> calibre, with a security mess on his hands:
>
> https://bugs.launchpad.net/calibre/+bug/885027
To expand on what Neil said...
* my configuration does not use suid. It passes a parameter to a script
that runs under sudo
* pmount and pumount are abreviations for "policy mount" and "policy
umount". It has its own security policy, namely that it will only
mount/unmount devices in /media
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-13 18:56 ` Canek Peláez Valdés
@ 2012-09-14 5:42 ` Stefan G. Weichinger
2012-09-16 18:45 ` Canek Peláez Valdés
0 siblings, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-14 5:42 UTC (permalink / raw
To: gentoo-user
Am 2012-09-13 20:56, schrieb Canek Peláez Valdés:
> On Thu, Sep 13, 2012 at 1:08 PM, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Am 13.09.2012 19:48, schrieb Canek Peláez Valdés:
>>> On Thu, Sep 13, 2012 at 12:29 PM, Canek Peláez Valdés <caneko@gmail.com> wrote:
>>> [snip]
>>>> I actually hadn't thought about downgrading polkit, since it was
>>>> working with the same version in GNOME 3.2. Or maybe it was a fluke
>>>> (the bug is reproducible, but sometimes I need to try several times).
>>>> I will try downgrading.
>>>
>>> Didn't work with 0.106-r7 (which I had to hunt from the Attic), and I
>>> cannot downgrade to 0.104 since udisks:2 depends on it. So I suppose
>>> we need to nudge David again.
>>
>> Yes, that conflict sounds familiar ... I hit that one also!
>
> I took another look at polkit's and gnome-shell's source code. I
> didn't do it before since I have work to do and (as I said) the
> problems are somewhat workaroundables. After looking at the code, the
> plot thickens:
>
> gnome-shell registers itself to polkit as a PolkitUnixSession:
>
> http://git.gnome.org/browse/gnome-shell/tree/src/shell-polkit-authentication-agent.c?id=3.4.2#n106
>
> polkit will not deal with that in subject_to_jsval:
>
> http://cgit.freedesktop.org/polkit/tree/src/polkitbackend/polkitbackendjsauthority.c?id=0.107#n730
>
> The funny thing? Both code paths were written by David Zeuthen, which
> by the way is the one handling the bug.
>
> It gets better: I changed gnome-shell's code so it registers itself as
> PolkitUnixProcess (which supposedly is handled by subject_to_jsval),
> and I put printf's in the function subject_to_jsval. It turns out
> that, no matter that it actually gets registered as unix-process,
> gnome-shell it's also registered (at some point) as unix-session.
>
> My feeling is that gnome-shell should get registered as
> system-bus-name (which it does), and that should be the "primary"
> interface of gnome-shell for polkit. However, in Gentoo (I haven't
> found any other mention of this bug in any other distro), somehow the
> unix-session interface takes control.
>
> I updated the bug:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=53905
>
> and I hope David will respond soon.
Great to hear, thanks so far.
Looking forward to his reply ....
Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-14 5:42 ` Stefan G. Weichinger
@ 2012-09-16 18:45 ` Canek Peláez Valdés
2012-09-17 14:23 ` Stefan G. Weichinger
2012-09-17 15:45 ` Stefan G. Weichinger
0 siblings, 2 replies; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-16 18:45 UTC (permalink / raw
To: gentoo-user
On Fri, Sep 14, 2012 at 12:42 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
[snip]
> Great to hear, thanks so far.
> Looking forward to his reply ....
Stefan, do you use systemd? David told me that he could only check the
bug on monday, so I did a little research on the weekend. I installed
Gentoo in a QEMU VM (using gnome-boxes), to see if I could reproduce
the bug in a unmodified Gentoo installation (I use my systemd-only
overlay). I could reproduce the bug, but I found a reasonable
workaround:
cat /etc/portage/package.use/no-systemd
gnome-base/gdm -systemd
gnome-base/gnome-session -systemd
gnome-base/gnome-shell -systemd
sys-auth/polkit -systemd
If those four packages have systemd support disabled, then everything
works as expected (the suspend/hibernate options returns, I can
mount/umount USB sticks, etc.) If at least one of those packages have
the systemd USE flag, then the bug appears. I updated the bug report
(and I'm not really sure the bug is in polkit or gnome-shell):
https://bugs.freedesktop.org/show_bug.cgi?id=53905
This workaround also works in my systemd-only overlay. So, if you have
the systemd flag in any of those four packages, disable it and
everything should work. Just to be explicit, the versions are:
gnome-base/gdm-3.4.1-r1
gnome-base/gnome-session-3.4.2.1
gnome-base/gnome-shell-3.4.2
sys-auth/polkit-0.107:0
I was really looking forward to use the integration of systemd into
GNOME, but I suppose it's still a little green. Hopefully we will find
and fix the exact bug soon; meanwhile, this workaround is much more
usable than using pmount, pm-suspend, etc.
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-16 18:45 ` Canek Peláez Valdés
@ 2012-09-17 14:23 ` Stefan G. Weichinger
2012-09-17 15:45 ` Stefan G. Weichinger
1 sibling, 0 replies; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-17 14:23 UTC (permalink / raw
To: gentoo-user
Am 16.09.2012 20:45, schrieb Canek Peláez Valdés:
> On Fri, Sep 14, 2012 at 12:42 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
> [snip]
>> Great to hear, thanks so far.
>> Looking forward to his reply ....
>
> Stefan, do you use systemd?
I don't boot with systemd now (yes, kinda green) ... but have the
USE-flags set.
I will re-compile the mentioned packages without that flag now, to test.
Right now I have some weird issue with an erratic mouse, maybe this gets
fixed with today's updates as well (just returned to my office now ...)
Reports soon, thanks!
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-16 18:45 ` Canek Peláez Valdés
2012-09-17 14:23 ` Stefan G. Weichinger
@ 2012-09-17 15:45 ` Stefan G. Weichinger
2012-09-25 6:33 ` Canek Peláez Valdés
1 sibling, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-17 15:45 UTC (permalink / raw
To: gentoo-user
Am 16.09.2012 20:45, schrieb Canek Peláez Valdés:
> This workaround also works in my systemd-only overlay. So, if you have
> the systemd flag in any of those four packages, disable it and
> everything should work. Just to be explicit, the versions are:
>
> gnome-base/gdm-3.4.1-r1
> gnome-base/gnome-session-3.4.2.1
> gnome-base/gnome-shell-3.4.2
> sys-auth/polkit-0.107:0
confirming this. I have exactly your mentioned versions with
USE="-systemd" and suspend/hibernate option returns, I could mount/use a
DVD right now ... yes!
thanks, Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-17 15:45 ` Stefan G. Weichinger
@ 2012-09-25 6:33 ` Canek Peláez Valdés
2012-09-25 8:09 ` Stefan G. Weichinger
0 siblings, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-25 6:33 UTC (permalink / raw
To: gentoo-user
On Mon, Sep 17, 2012 at 10:45 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 16.09.2012 20:45, schrieb Canek Peláez Valdés:
>
>> This workaround also works in my systemd-only overlay. So, if you have
>> the systemd flag in any of those four packages, disable it and
>> everything should work. Just to be explicit, the versions are:
>>
>> gnome-base/gdm-3.4.1-r1
>> gnome-base/gnome-session-3.4.2.1
>> gnome-base/gnome-shell-3.4.2
>> sys-auth/polkit-0.107:0
>
> confirming this. I have exactly your mentioned versions with
> USE="-systemd" and suspend/hibernate option returns, I could mount/use a
> DVD right now ... yes!
OK; now I can put this whole thing behind me. You can read the bug again:
https://bugs.freedesktop.org/show_bug.cgi?id=53905
but the short answer is that you cannot let both systemd and
consolekit to manage sessions. The problem (in my case) was that I was
using accountsservice 0.6.22, which depends on consolekit. I upgraded
to accountsservice 0.6.24 (which can depend on systemd), I removed all
consolekit USE-flags (except for bluez: bluez uses consolekit to pull
either consolekit or systemd; I reported a bug[1]), and after an
emerge -uDNv world, I removed consolekit (I didn't had any other
package depending on it).
Now everything works as it should, in both my overlay and in the
vanilla Gentoo tree. Be aware: it works *with systemd*; maybe it works
without it, but I don't know (nor care). All the GNOME session
management is moving to systemd, and I think it's a great idea.
Support for consolekit (which is no longer maintained) is still there,
but I don't know for how long.
If you want to keep using (the unmaintained) consolekit, be sure to
set "-systemd" in your USE flags. Do not mix systemd and consolekit,
or this bug will hit you.
Regards.
[1] https://bugs.gentoo.org/show_bug.cgi?id=436180
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-25 6:33 ` Canek Peláez Valdés
@ 2012-09-25 8:09 ` Stefan G. Weichinger
2012-09-25 8:32 ` Stefan G. Weichinger
0 siblings, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-25 8:09 UTC (permalink / raw
To: gentoo-user
Am 25.09.2012 08:33, schrieb Canek Peláez Valdés:
> On Mon, Sep 17, 2012 at 10:45 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Am 16.09.2012 20:45, schrieb Canek Peláez Valdés:
>>
>>> This workaround also works in my systemd-only overlay. So, if you have
>>> the systemd flag in any of those four packages, disable it and
>>> everything should work. Just to be explicit, the versions are:
>>>
>>> gnome-base/gdm-3.4.1-r1
>>> gnome-base/gnome-session-3.4.2.1
>>> gnome-base/gnome-shell-3.4.2
>>> sys-auth/polkit-0.107:0
>>
>> confirming this. I have exactly your mentioned versions with
>> USE="-systemd" and suspend/hibernate option returns, I could mount/use a
>> DVD right now ... yes!
>
> OK; now I can put this whole thing behind me. You can read the bug again:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=53905
>
> but the short answer is that you cannot let both systemd and
> consolekit to manage sessions. The problem (in my case) was that I was
> using accountsservice 0.6.22, which depends on consolekit. I upgraded
> to accountsservice 0.6.24 (which can depend on systemd), I removed all
> consolekit USE-flags (except for bluez: bluez uses consolekit to pull
> either consolekit or systemd; I reported a bug[1]), and after an
> emerge -uDNv world, I removed consolekit (I didn't had any other
> package depending on it).
>
> Now everything works as it should, in both my overlay and in the
> vanilla Gentoo tree. Be aware: it works *with systemd*; maybe it works
> without it, but I don't know (nor care). All the GNOME session
> management is moving to systemd, and I think it's a great idea.
> Support for consolekit (which is no longer maintained) is still there,
> but I don't know for how long.
>
> If you want to keep using (the unmaintained) consolekit, be sure to
> set "-systemd" in your USE flags. Do not mix systemd and consolekit,
> or this bug will hit you.
>
> Regards.
>
> [1] https://bugs.gentoo.org/show_bug.cgi?id=436180
Thanks a lot for the feedback.
So if I don't use systemd right now, it would be better to keep
consolekit? I give it a try now ... compiling stuff without that flag
for a test.
Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-25 8:09 ` Stefan G. Weichinger
@ 2012-09-25 8:32 ` Stefan G. Weichinger
2012-09-25 16:49 ` Canek Peláez Valdés
0 siblings, 1 reply; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-25 8:32 UTC (permalink / raw
To: gentoo-user
Am 25.09.2012 10:09, schrieb Stefan G. Weichinger:
> So if I don't use systemd right now, it would be better to keep
> consolekit? I give it a try now ... compiling stuff without that flag
> for a test.
Did not work. Rather easy to understand, if neither systemd or
consolekit is there, how should things work ...
Re-enabled USE-flag "consolekit" for now, re-emerged 4 pkgs, ok now.
Maybe I will try systemd again soon ...
Thanks, Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-25 8:32 ` Stefan G. Weichinger
@ 2012-09-25 16:49 ` Canek Peláez Valdés
2012-09-26 7:46 ` Stefan G. Weichinger
0 siblings, 1 reply; 38+ messages in thread
From: Canek Peláez Valdés @ 2012-09-25 16:49 UTC (permalink / raw
To: gentoo-user
On Tue, Sep 25, 2012 at 3:32 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
> Am 25.09.2012 10:09, schrieb Stefan G. Weichinger:
>
>> So if I don't use systemd right now, it would be better to keep
>> consolekit? I give it a try now ... compiling stuff without that flag
>> for a test.
>
> Did not work. Rather easy to understand, if neither systemd or
> consolekit is there, how should things work ...
>
> Re-enabled USE-flag "consolekit" for now, re-emerged 4 pkgs, ok now.
>
> Maybe I will try systemd again soon ...
It's not only the use flag; if you set USE=systemd, you need to boot
with systemd. Otherwise, set USE="consolekit -systemd".
Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [gentoo-user] USB automount
2012-09-25 16:49 ` Canek Peláez Valdés
@ 2012-09-26 7:46 ` Stefan G. Weichinger
0 siblings, 0 replies; 38+ messages in thread
From: Stefan G. Weichinger @ 2012-09-26 7:46 UTC (permalink / raw
To: gentoo-user
Am 25.09.2012 18:49, schrieb Canek Peláez Valdés:
> On Tue, Sep 25, 2012 at 3:32 AM, Stefan G. Weichinger <lists@xunil.at> wrote:
>> Am 25.09.2012 10:09, schrieb Stefan G. Weichinger:
>>
>>> So if I don't use systemd right now, it would be better to keep
>>> consolekit? I give it a try now ... compiling stuff without that flag
>>> for a test.
>>
>> Did not work. Rather easy to understand, if neither systemd or
>> consolekit is there, how should things work ...
>>
>> Re-enabled USE-flag "consolekit" for now, re-emerged 4 pkgs, ok now.
>>
>> Maybe I will try systemd again soon ...
>
> It's not only the use flag; if you set USE=systemd, you need to boot
> with systemd. Otherwise, set USE="consolekit -systemd".
I think this should go into the wiki or so.
I always assumed that adding the flag "systemd" just somehow enhanced my
packages with systemd-compatibility and I could then simply switch
between init-systems as I like. It wasn't clear to me that it somehow
disabled stuff or made my binaries incompatible with eg. consolekit.
For now I stay with my working openrc-based setup, I have other things
to test and will only re-compile stuff for systemd when I find more time
again.
Thanks so far for your investigation on this bug, Stefan
^ permalink raw reply [flat|nested] 38+ messages in thread
end of thread, other threads:[~2012-09-26 7:48 UTC | newest]
Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 22:56 [gentoo-user] USB automount Chris Stankevitz
2012-09-11 5:03 ` Walter Dnes
2012-09-11 8:56 ` Philip Webb
2012-09-11 9:41 ` Neil Bothwick
2012-09-11 21:55 ` Walter Dnes
2012-09-11 22:42 ` Michael Mol
2012-09-11 22:51 ` Neil Bothwick
2012-09-12 2:47 ` Walter Dnes
2012-09-12 8:03 ` Neil Bothwick
2012-09-13 6:50 ` Walter Dnes
2012-09-13 8:32 ` Neil Bothwick
2012-09-13 14:19 ` Canek Peláez Valdés
2012-09-13 14:42 ` Neil Bothwick
2012-09-13 14:49 ` Canek Peláez Valdés
2012-09-13 16:21 ` Stefan G. Weichinger
2012-09-13 16:41 ` Canek Peláez Valdés
2012-09-13 17:14 ` Stefan G. Weichinger
2012-09-13 17:29 ` Canek Peláez Valdés
2012-09-13 17:48 ` Canek Peláez Valdés
2012-09-13 18:08 ` Stefan G. Weichinger
2012-09-13 18:56 ` Canek Peláez Valdés
2012-09-14 5:42 ` Stefan G. Weichinger
2012-09-16 18:45 ` Canek Peláez Valdés
2012-09-17 14:23 ` Stefan G. Weichinger
2012-09-17 15:45 ` Stefan G. Weichinger
2012-09-25 6:33 ` Canek Peláez Valdés
2012-09-25 8:09 ` Stefan G. Weichinger
2012-09-25 8:32 ` Stefan G. Weichinger
2012-09-25 16:49 ` Canek Peláez Valdés
2012-09-26 7:46 ` Stefan G. Weichinger
2012-09-13 17:54 ` Stefan G. Weichinger
2012-09-13 17:31 ` Canek Peláez Valdés
2012-09-13 17:55 ` Stefan G. Weichinger
2012-09-13 23:41 ` Walter Dnes
2012-09-12 11:11 ` Philip Webb
2012-09-11 10:18 ` [gentoo-user] " Nikos Chantziaras
2012-09-11 15:30 ` [gentoo-user] " Chris Stankevitz
2012-09-11 16:43 ` Canek Peláez Valdés
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox