You are not logged in.

#1 2014-06-17 15:13:09

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

[SOLVED] [udev] invalid key/value pair in custom rule

Hey,

this simple rule in /etc/udev/rules.d/99-usb-backup.rules, which is used to automatically mount my encrypted backup disk when plugging in run a backup script after the backup disk has been mounted, is said to be invalid:

SUBSYSTEMS=="usb", ATTRS{idProduct}=="0470", ATTRS{serial}=="2080000048FD", ACTION=="add", ENV{SYSTEMD_WANTS}=="secbackup.service"

(The service file will mount the volume and start the backup script; mounting is done via udiskie.)

The following error pops up when booting the system:

systemd-udevd[225]: invalid key/value pair in file /etc/udev/rules.d/99-usb-backup.rules on line 1,starting at character 131 (':')

I don't see any colon (':') in my rule and the last closing quotation mark (") is the 130th character in this file...

This worked well before; I don't know when the error started to pop up. I use systemd 213-9.

Any hints?

Last edited by ball (2014-06-18 09:28:24)

Offline

#2 2014-06-17 19:15:55

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] [udev] invalid key/value pair in custom rule

Shouldn't that last “==” be “+=”?

If that's just a typo on your part, are there any non-printing characters? Use “od” to check:

od -c /etc/udev/rules.d/99-usb-backup.rules

Offline

#3 2014-06-17 19:41:55

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: [SOLVED] [udev] invalid key/value pair in custom rule

ukhippo wrote:

Shouldn't that last “==” be “+=”?

Well... I don't know. I've taken this snippet from jasonwryan's blog post. I guess it's correct...

ukhippo wrote:

If that's just a typo on your part, are there any non-printing characters? Use “od” to check:

od -c /etc/udev/rules.d/99-usb-backup.rules

Nothing suspicious:

0000000   S   U   B   S   Y   S   T   E   M   S   =   =   "   u   s   b
0000020   "   ,       A   T   T   R   S   {   i   d   P   r   o   d   u
0000040   c   t   }   =   =   "   0   4   7   0   "   ,       A   T   T
0000060   R   S   {   s   e   r   i   a   l   }   =   =   "   2   0   8
0000100   0   0   0   0   0   4   8   F   D   "   ,       A   C   T   I
0000120   O   N   =   =   "   a   d   d   "   ,       E   N   V   {   S
0000140   Y   S   T   E   M   D   _   W   A   N   T   S   }   =   =   "
0000160   s   e   c   b   a   c   k   u   p   .   s   e   r   v   i   c
0000200   e   "
0000202

Offline

#4 2014-06-17 23:27:28

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] [udev] invalid key/value pair in custom rule

I can't see how that rule, as written, would work. It has comparison keys but no assignment keys - so even if all keys matched there's nothing to do. It looks like the last comparison should really be an assignment.

That wouldn't explain the error though.

From your “od” output I can see your line is not terminated with a newline - you could try adding a newline.

Offline

#5 2014-06-18 09:31:21

ball
Member
From: Germany
Registered: 2011-12-23
Posts: 164

Re: [SOLVED] [udev] invalid key/value pair in custom rule

The missing newline was the issue. Thanks.

I made a mistake in my initial post: the sevice file won't mount the volume but run a script after the volume has been mounted -- therefore there doesn't have to be an assignment in the last expression. Then this whole rule seems superfluous, as you stated... Hm. I'll try to remove this thing... (In this case your're even more helpful!)

EDIT: Yep. Completely unnecessary.

Last edited by ball (2014-06-18 09:43:50)

Offline

Board footer

Powered by FluxBB