You are not logged in.

#1 2012-10-19 22:00:39

Dirk Sohler
Member
From: Hamburg, Germany
Registered: 2009-10-03
Posts: 109

[(semi-)SOLVED] 3 systemd annoyances

Hi there!

After some research on systemd I finally made it and switched to a systemd only configuration which works nearly perfect. The system starts up properly in most cases (see below). Its even a bit faster than before. It’s all fine except three things i want to fix. I hope for some great hints from the awesome community for fixing my systemd installation.


1. race condition … or so?

For some reasons I can’t figure out sometimes my system stars up without keyboard support (USB). Everything works. systemd shuts the system down on pressing power button, I can connect to the machine via SSH, the only thing that doesn’t seem to work is the keyboard (the Num Lock LED stays of and can’t be toggled and I can’t input any text or switch TTYs). After rebooting it works like charm – or not – but mostly it does smile Any hints where to track this down?


2. SSHFS mounts from /etc/fstab are not mounted

While using SysVinit all of my SSHFS mounts in /etc/fstab were mounted properly after system boot. This seems not to work with systemd. On boot there aren’t any visible error messages, but systemctl shows status loaded failed failed for media-archiv-usenet.mount (one of my SSHFS mounts, none of them works) … and:

my fstab (reduced to example, the other SSHFS mounts are in same style)
systemctl status media-archiv-usenet.mount

Manual mount via mount /media/archiv/usenet works. systemctl start media-archiv-usenet.mount works too. Only automatic mounting on system boot doesn’t.

After re-entering the whole SSHFS mount configuration according to the line given by firecat53 my SSHFS mounts get finally mounted. Research and a hint in German forum pointed out, that systemd doesn’t use a shell for mounting and therefore has no idea of what key file to use.


3. My home partition gets mounted in /media

The title says it. I have absolutely no clue where to begin with research on this. /media/home is another mount point for my /home. mount shows this:

[…]
/dev/sda3 on /media/home type ext4 (rw,relatime,data=ordered)
/dev/sda3 on /home type ext4 (rw,relatime,data=ordered)

systemctl status media-home.mount

Neither I set up anything like nor want I my home mounted in /media/home, too. How can I get rid of /media/home and media-home.mount in a clean and permanent way?

For some reason the same UDEV rule results in different behavior either it’s SysVinit or systemd. Removing the rule removed the problem described here – It removes the ability to auotmount USB stick drives, too, but hey! smile


Apart from that systemd works for me very well. Changing from SysVinit to systemd worked with some support from the IRC channel and the wiki. If there only weren’t this three annoying little … things … sad

Thanks in advance for your support on this!

Kind regards,
Dirk

Last edited by Dirk Sohler (2012-10-20 13:33:06)

Offline

#2 2012-10-19 22:15:04

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

Re: [(semi-)SOLVED] 3 systemd annoyances

For 3, I have no idea where that came from, but have you tried "systemctl disable media-home.mount" followed by a reboot.  Alternately just remove any links to media-home.mount in the /etc/systemd/*/ directories.


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

Offline

#3 2012-10-19 22:25:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [(semi-)SOLVED] 3 systemd annoyances

2. Have you tried searching? There are quite a few threads with fixes for this issue.

3. Look at your udev rules.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2012-10-19 22:55:54

Dirk Sohler
Member
From: Hamburg, Germany
Registered: 2009-10-03
Posts: 109

Re: [(semi-)SOLVED] 3 systemd annoyances

# systemctl disable media-home.mount
Failed to issue method call: No such file or directory

Udev has exactly ONE rule in /etc/udev/rules.d. It’s for auto mounting USB stick drives plugging in. The rule file starts with KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end" so it ignores /dev/sda3. I think it’s a systemd thing, because I didn’t change anything for udev and with SysVinit my home wasn’t mounted in /media/home.

And yes, I did some research on that SSHFS thing in google and in the forums. There was a lot of “it magically works for no reason because I didn’t change anything and just rebooted” and adding x- parameters in various ways to fstab. I tried all of the things I found … no sshfs automount on system boot.

Offline

#5 2012-10-19 23:00:22

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [(semi-)SOLVED] 3 systemd annoyances

Working sshfs automount:

firecat53@my.ip.net:/mnt/media                /mnt/media      fuse.sshfs      noauto,x-systemd.automount,users,idmap=user,Port=22,IdentityFile=/home/firecat53/.ssh/id_rsa,allow_other,reconnect

Mounts immediately on first access.

Scott

Offline

#6 2012-10-19 23:13:28

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

Re: [(semi-)SOLVED] 3 systemd annoyances

As I'm still learning systemd I wasn't sure if my "systemctl disable ..." command was the proper way to disable a mount unit file.  That's why I provided the second option of manually removing any links to home-media.mount in the /etc/systemd/* directories.  This is all a "disable" command would do anyways.

If there is no media-home.mount unit file in one of those directories, then I think there must be an entry in your fstab causing the second mounting of home.


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

Offline

#7 2012-10-19 23:36:35

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [(semi-)SOLVED] 3 systemd annoyances

Dirk Sohler wrote:

The rule file starts with KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end" so it ignores /dev/sda3

How so? /dev/sda3 is not matched by that rule, so it would not be skipped... (unless I'm misunderstanding something).

Offline

#8 2012-10-19 23:49:32

Dirk Sohler
Member
From: Hamburg, Germany
Registered: 2009-10-03
Posts: 109

Re: [(semi-)SOLVED] 3 systemd annoyances

firecat53 wrote:

Working sshfs automount:

Already tried that yesterday sad

Trilby wrote:

If there is no media-home.mount unit file in one of those directories, then I think there must be an entry in your fstab causing the second mounting of home.

Systemd creates the xxxx.mount files from fstab entries. They’re completely “virtual” in that case. I can use them with systemctl, but there are no actual files I could delete, nor can I enable or disable them.

tomegun wrote:

How so? /dev/sda3 is not matched by that rule, so it would not be skipped... (unless I'm misunderstanding something).

I took that rule from the German wiki. In English wiki is an example for setting group for optical media to disk using the same syntax without /dev/. But I still think there is nothing wrong with udev, because I can reproduce this behavior when switching between systemd and SysVinit (just installed it again for testing).

Last edited by Dirk Sohler (2012-10-19 23:51:53)

Offline

#9 2012-10-19 23:54:19

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [(semi-)SOLVED] 3 systemd annoyances

Dirk Sohler wrote:
firecat53 wrote:

Working sshfs automount:

tomegun wrote:

How so? /dev/sda3 is not matched by that rule, so it would not be skipped... (unless I'm misunderstanding something).

I took that rule from the German wiki. In English wiki is an example for setting group for optical media to disk using the same syntax without /dev/. But I still think there is nothing wrong with udev, because I can reproduce this behavior when switching between systemd and SysVinit (just installed it again for testing).

The line does exactly one thing: if the identifier is not sd followed by a letter followed by a number then skip the mount. sda3 matches the expression, so the mount is not skipped. You should check for sd[b-z][0-9] to ignore your primary disk.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#10 2012-10-20 01:41:39

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [(semi-)SOLVED] 3 systemd annoyances

Dirk Sohler wrote:
firecat53 wrote:

Working sshfs automount:

Already tried that yesterday sad

Then you are doing it wrong.

Dirk Sohler wrote:
tomegun wrote:

How so? /dev/sda3 is not matched by that rule, so it would not be skipped... (unless I'm misunderstanding something).

I took that rule from the German wiki. In English wiki is an example for setting group for optical media to disk using the same syntax without /dev/. But I still think there is nothing wrong with udev, because I can reproduce this behavior when switching between systemd and SysVinit (just installed it again for testing).

As has been pointed out, your device matches the rule. Again, if you had searched, you would have found other threads about this very issue. FWIW: switching between init methods has nothing to do with the behaviour; rather than disregarding the advice the community is giving you (again), you could do us the courtesy of actually testing it by changing the rule.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2012-10-20 10:00:23

Dirk Sohler
Member
From: Hamburg, Germany
Registered: 2009-10-03
Posts: 109

Re: [(semi-)SOLVED] 3 systemd annoyances

jasonwryan wrote:

FWIW: switching between init methods has nothing to do with the behaviour;

Then why does SysVinit not mount the file system but systemd does? I just don’t understand it …

*brb testing*

Edit: So … home doesn’t get mounted anymore in wrong location. But i still don’t understand why SysVinit didn’t mount home, but systemd does. I didn’t touch the rule since forever. Anyways … This rule didn’t work very well, at all (sometimes it just did not mount a USB stick drive when plugged in, and sometimes it left over the empty mount point after removing the USB stick drive). Is there something, systemd can do for me, here?

Additional: I just completely removed any of my SSHFS definitions in fstab and re-entered them with the exact line (and not only the x-systemd.automount and IdentityFile) firecat53 used, now this works, too – even if systemctl still shows “loaded failed failed” until accessed the first time.

This chops all my problems down to one smile Thanks community ♥

Last edited by Dirk Sohler (2012-10-20 10:14:39)

Offline

#12 2012-10-23 14:38:51

kelvinh
Member
Registered: 2012-09-15
Posts: 13

Re: [(semi-)SOLVED] 3 systemd annoyances

Dirk Sohler wrote:

Hi there!

After some research on systemd I finally made it and switched to a systemd only configuration which works nearly perfect. The system starts up properly in most cases (see below). Its even a bit faster than before. It’s all fine except three things i want to fix. I hope for some great hints from the awesome community for fixing my systemd installation.


1. race condition … or so?

For some reasons I can’t figure out sometimes my system stars up without keyboard support (USB). Everything works. systemd shuts the system down on pressing power button, I can connect to the machine via SSH, the only thing that doesn’t seem to work is the keyboard (the Num Lock LED stays of and can’t be toggled and I can’t input any text or switch TTYs). After rebooting it works like charm – or not – but mostly it does smile Any hints where to track this down?
things … sad
...

I met the same keyboard problem.. but my condition is worse, I always cannot input anything, so until now I have not logged into my system.. sad

Offline

Board footer

Powered by FluxBB