I prefer network to setup itself when I start computer, but I prefer to boot earlier and have network connect while I type my password and so on.

Sadly, according to systemd-analyze critical-chain I am waiting for NetworkManager.service startup during boot.

Is there a way to change that so that it still does its network things and it is not delaying boot?

graphical.target @8.083s
└─multi-user.target @8.083s
  └─postfix.service @8.075s +7ms
    └─[email protected] @3.904s +4.169s
      └─network-online.target @3.880s
        └─network.target @3.880s
          └─NetworkManager.service @3.495s +384ms
            └─dbus.service @3.492s
              └─basic.target @3.472s
                └─sockets.target @3.472s
                  └─docker.socket @3.469s +2ms
                    └─sysinit.target @3.464s
                      └─snapd.apparmor.service @3.131s +332ms
                        └─apparmor.service @2.990s +136ms
                          └─local-fs.target @2.989s
                            └─run-snapd-ns-cups.mnt.mount @5.417s
                              └─run-snapd-ns.mount @4.544s
                                └─local-fs-pre.target @528ms
                                  └─keyboard-setup.service @376ms +152ms
                                    └─systemd-journald.socket @361ms
                                      └─system.slice @354ms
                                        └─-.slice @354ms
  • 2
    Network manager is introducing 384ms delay to the boot process. That is less than half a second. [email protected] has a larger delay. Are you under the impression the delay for network manager is 3.495 seconds?
    – PonJar
    Jan 24, 2023 at 12:59
  • 1
    @PonJar no, but this one is obviously misplaced and has no reason whatsoever to delay boot by even a millisecond. Though if that postfix service is the same postfix as one described as "Postfix is the default Mail Transfer Agent" then I will also need to find way to start it without delaying boot. It is absurd that I wait for this service to start, it should load while I type password. Good catch. Jan 25, 2023 at 17:44
  • 2
    I’m sure it’s possible to alter the dependencies between services and targets by editing unit files. However you would have to think carefully about any unexpected consequences of doing so. There is an interesting question and answer about displaying dependencies and dependents of services here unix.stackexchange.com/questions/422097/… I guess you would need to get familiar with this if you want to change things such as making network manager not a dependency of graphical target. I assume you are familiar with unit file structure
    – PonJar
    Jan 25, 2023 at 21:35
  • Why don't you remove network-manager and test your boot scenario again. And then re install it, it's easy enough. askubuntu.com/questions/1091653/… Jan 28, 2023 at 5:03
  • 1
    What happens if you remove --no-daemon from /lib/systemd/system/NetworkManager.service? Not sure how this affects other services, and, if it works, I bet there is a "right"TM place to do that change. This is so much easier in OpenRC...
    – Quasímodo
    Feb 1, 2023 at 18:20

1 Answer 1


There are two approaches:

1. Edit override config (/etc/systemd/system/network-online.target.d/override.conf)

Type command sudo systemctl edit network-online.target

paste the following config lines


That will create an override config at /etc/systemd/system/network-online.target.d/override.conf, which will partially override /etc/systemd/system/network-online.target.

2. Edit unit directly (/etc/systemd/system/network-online.target)

Type command sudo systemctl edit network-online.target --full

Find After= in [Unit] section and change the value to graphical.target

If you accidentally break the configuration, you can find the original one at /lib/systemd/system/network-online.target.

  • sudo systemctl edit --force --full <your-service.service> to create a new service

  • man systemd.unit to read the manual

  • multi-user.target and graphics services are before graphical.target (ref)

man systemd.special to read special systemd units manual

Units that strictly require a configured network connection should pull in network-online.target (via a Wants= type dependency) and order themselves after it. This target unit is intended to pull in a service that delays further execution until the network is sufficiently set up. What precisely this requires is left to the implementation of the network managing service.

A special target unit for setting up a multi-user system (non-graphical). This is pulled in by graphical. Units that are needed for a multi-user system shall add Wants= dependencies for their unit to this unit during installation. This is best configured via WantedBy=multi-user.target in the unit's [Install] section.

A special target unit for setting up a graphical login screen. This pulls in multi-user.target. Units that are needed for graphical logins shall add Wants= dependencies for their unit to this unit (or multi-user.target) during installation. This is best configured via WantedBy=graphical.target in the unit's [Install] section.

  • Note that at least for me it wants to edit /etc/systemd/system/network-online.target.d/override.conf which is empty. ("Put the following config lines between the comments.") Jan 30, 2023 at 11:54
  • Just in case: do you maybe know how to apply such change with Ansible? Jan 30, 2023 at 11:55
  • 1
    @reducingactivity Sorry for confusing you, I have the comments ### Editing /etc/systemd/system/network-online.target.d/override.conf ### Anything between here and the comment below will become the new contents of the file and ### Lines below this comment will be discarded when I using sudo systemctl edit network-online.target. I think these comments is for convenience to reference the original config. (I am not sure why I have these comments, it's helpful tho) I have remove these sentence about comments and add one more approach, to avoid the confusion.
    – cpprust
    Jan 30, 2023 at 18:21
  • @reducingactivity If I edit the config (/etc/systemd/system/network-online.target.d/override.conf) via text editor (e.g. vim), there are no comments exist. I think those comments are hints provide by systemctl only visible when edit through command.
    – cpprust
    Jan 30, 2023 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .