You are not logged in.

#1 2014-10-09 11:38:37

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,394

[solved]Trying to insert a blocking systemd unit into the boot process

What i'm trying to do is to start (and *wait* for it to complete) a unit before starting another.

In particular, i need to create and mount a partition on the fly before any filesystem gets mounted.

My unit file is:

# cat /etc/systemd/system/early-boot-koko.service 
[Unit]
Description=Configurazione ottimale per il boot da rete
[Service]
Before=systemd-remount-fs.service
#Nice=19
#IOSchedulingClass=3
#IOSchedulingPriority=7

Type=oneshot # is forking instead of oneshot needed here?
ExecStart=/root/scripts/early-boot.sh
TimeoutSec=0
#StandardInput=tty
RemainAfterExit=yes

I created even created an override to systemd-remount-fs.service and added early-boot-koko.service to the "After" array:

]# cat /etc/systemd/system/systemd-remount-fs.service 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Remount Root and Kernel File Systems
Documentation=man:systemd-remount-fs.service(8)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-fsck-root.service early-boot-koko.service
Before=local-fs-pre.target local-fs.target shutdown.target
Wants=local-fs-pre.target
ConditionPathExists=/etc/fstab

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-remount-fs

But when i boot, i notice that early-boot-koko.service is still running while systemd-remount-fs has exited :

# systemctl |grep 'early\|remount'
  early-boot-koko.service                                                                  loaded active running   Configurazione ottimale per il boot da rete
  systemd-remount-fs.service                                                               loaded active exited    Remount Root and Kernel File Systems

...but i need  early-boot-koko.service to complete before systemd-remount-fs is started.

What am i doing wrong?

Thanks.

Last edited by kokoko3k (2014-10-09 12:14:23)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2014-10-09 12:14:10

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,394

Re: [solved]Trying to insert a blocking systemd unit into the boot process

...it was the comment on the same line:

  Type=oneshot # is forking instead of oneshot needed here?

solved...


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB