Hi Mirek,

On Thu, 21 Apr 2016, Miloslav Trmac wrote:

Hello,
2016-04-20 18:59 GMT+02:00 Faheem Mitha <fah...@faheem.info>:

      When I try to mount an external USB drive using udiskie-mount from
      inside a cron job, I get an error as follows below. Using
      udiskie-mount directly from the command line works fine.

<snip>

      From a big picture perspective, I don't really understand why
      mounting directly from the command line is treated differently
      from a cron job. Can someone enlighten me?

polkit is treating “local users” and “active local users” differently (precisely so that users who are physically able to insert or remove a disk can mount/unmount it). A cron job is, I expect, classified as neither a local user nor as an active local user.

I’m afraid I don’t think there are standalone format validators / testing tools for the permission files; check system logs, and output of polkitd to stdout/stderr (running it without --no-debug, and perhaps with G_MESSAGES_DEBUG=all in the environment).

I got a working version of permissions to allow `udiskie-mount` and `udiskie-umount` to run inside a cron job. The file location is `/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla`. The contents are:

[udisks2]
Identity=unix-user:faheem
Action=org.freedesktop.udisks2.filesystem-mount-other-seat;org.freedesktop.udisks2.filesystem-mount
ResultAny=yes

per comments by Thomas H (the udiskie maintainer) - see issue 102 below. Are both these actions needed? Comments welcome.

See also, the question I asked on unix.stackexchange.com, namely https://unix.stackexchange.com/q/277606/4671, and the later part of the Github udiskie issue https://github.com/coldfix/udiskie/issues/102.

I submitted a wishlist bug report to the Debian udiskie package about mentioning policykit, namely http://bugs.debian.org/822209. The maintainer asked for a patch.

I opened issue https://github.com/coldfix/udiskie/issues/111, including a suggested patch. Comments and suggestions for improvement are welcome.

                                                    Regards, Faheem Mitha
_______________________________________________
polkit-devel mailing list
polkit-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/polkit-devel

Reply via email to