You are not logged in.

#1 2013-01-03 05:29:54

boblitz13
Member
Registered: 2012-08-14
Posts: 19

udiskie systemd service?

I have recently been trying to move some of the processes from my xinitrc to systemd service files. My service file for slock has turned out nicely and I was considering trying the same for udiskie but I'm starting to wonder if that's a good idea. The major pro would be starting it at boot as currently I do not have a graphical login and occasionally just use the virtual terminal. Is there a way to set it up so that it reloads with correct user permissions when someone logs on or is there a better way of accomplishing what I want?

Last edited by boblitz13 (2013-01-04 10:15:28)

Offline

#2 2013-01-03 09:27:18

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: udiskie systemd service?

You need to use the not-quite-ready-for-primetime systemd user setup.

<edit>Why do you think starting udiskie at boot would be an advantage? It's meant to run as your user, so there's no benefit from running it before your user logs in.

Last edited by tomk (2013-01-03 09:30:23)

Offline

#3 2013-01-03 11:21:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,554
Website

Re: udiskie systemd service?

boblitz13 wrote:

The major pro would be starting it at boot as currently I do not have a graphical login and occasionally just use the virtual terminal. Is there a way to set it up so that it reloads with correct user permissions when someone logs on or are there better way of accomplishing what I want?

An alternative would be to have it started by your shell startup (eg bashrc).  Just make sure there is a conditional to check if it is already running.  So the first time you log in to a tty it will start.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2013-01-03 18:11:01

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: udiskie systemd service?

You could try creating a service for udiskie, using firecat53's devmon unit file as a template:

https://bbs.archlinux.org/viewtopic.php … 6#p1205536

Offline

#5 2013-01-04 10:14:37

boblitz13
Member
Registered: 2012-08-14
Posts: 19

Re: udiskie systemd service?

tomk wrote:

<edit>Why do you think starting udiskie at boot would be an advantage? It's meant to run as your user, so there's no benefit from running it before your user logs in.

While running udiskie upon login to a tty would be preferable, I would rather have it start at boot if I could figure out the permissions than have to start it manually if I'm not running X. However it looks like associating the service with multi-user.target should make it wait until login to start the service.

So far the permissions have been my major problem. I've written two service files, one before I first posted and one based on anonymous_user's suggestion, but both run into the same error:

failed to mount device /org/freedesktop/UDisks/devices/sdc1: org.freedesktop.UDisks.Error.PermissionDenied: Not Authorized

I've tried adding my own polkit rule to no avail and don't know what else I can do as logind is described on the wiki as just working out of the box. After quite a bit of looking, I have found nothing on manually configuring permissions for systemd services.

The systemd --user option also sounds promising but the wiki page just mentions adding it to xinitrc and configuring it for X. Is there potentially some way involving bashrc to configure it for console login?

Offline

Board footer

Powered by FluxBB