You are not logged in.

#1 2014-08-29 12:22:56

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Changing systemd service start order (crypttab & network)

I'm looking for some help in swapping around a dependency/start order (with systemd). I know what you're thinking! - and I know it's all "Wants=..." and things run in parallel and shouldn't need ordering, but here's my specific problem/requirement:

My home dir lives on an encrypted partition. Nothing fancy, just standard cryptsetup LUKS. Since systemd took over the world, it gets mounted through a line in /etc/crypttab, prompting for the passphrase on boot.
The only thing is that the network is not brought up until *after* the cryptsetup service has finished (i.e. password is right, and partition is mounted). This is causing a ~3-5 second delay on startup for DHCP to get an address. If dhcp was started in parallel with cryptsetup, then there wouldn't be any delay - by the time I type my passphrase in, the network would be ready.

To illustrate what I mean:

$ systemd-analyze blame
          7.429s systemd-cryptsetup@steven.service
          4.818s dhcpcd@eth0.service
            55ms systemd-logind.service
            53ms udisks.service
            51ms systemd-vconsole-setup.service
            50ms alsa-restore.service
            50ms iptables.service
            49ms haveged.service
            48ms systemd-hostnamed.service
            47ms avahi-daemon.service
            47ms rpcbind.service
            41ms polkit.service
            22ms systemd-udev-trigger.service
            15ms bluetooth.service
            14ms dev-hugepages.mount
            14ms systemd-rfkill@rfkill2.service
            13ms systemd-rfkill@rfkill1.service
            13ms sys-kernel-debug.mount
            13ms tmp.mount
            13ms dnsmasq.service
            11ms user@1000.service
            11ms systemd-modules-load.service
            10ms dev-mqueue.mount
            10ms systemd-tmpfiles-clean.service
             9ms systemd-tmpfiles-setup-dev.service
             8ms systemd-remount-fs.service
             7ms user@0.service
             6ms kmod-static-nodes.service
             5ms systemd-random-seed.service
             5ms systemd-ask-password-wall.service
             5ms systemd-journal-flush.service
             3ms var-log.mount
             3ms systemd-backlight@backlight:intel_backlight.service
             3ms home-steven.mount
             3ms systemd-sysctl.service
             3ms systemd-rfkill@rfkill0.service
             3ms systemd-tmpfiles-setup.service
             2ms systemd-update-utmp.service
             2ms systemd-udevd.service
             1ms systemd-user-sessions.service
             1ms sys-kernel-config.mount
             1ms var-cache.mount

That 4.818 seconds could be avoided if that could be parallelled with cryptsetup somehow.

Last edited by stevenhoneyman (2014-08-29 12:23:54)

Offline

Board footer

Powered by FluxBB