-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(network-manager): run as a service if systemd module is present
In the current state, services that depend on network need to use dracut hooks, since nothing with pull in the network targets into the transaction. In the future, it would be nice to provide developers on systemd-only systems the possibility to not use dracut hooks at all, but simply put normal systemd services into the initrd. Also, some modules even right now depend on systemd ordering, like cryptsetup, so let's make sure, that the ordering inside systemd work properly as well.
- Loading branch information
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is part of dracut. | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
[Unit] | ||
#make sure all devices showed up | ||
Wants=systemd-udev-settle.service | ||
After=systemd-udev-settle.service | ||
|
||
#pull the network targets into transaction | ||
Wants=network.target network-online.target | ||
Before=network.target network-online.target | ||
|
||
#run before we try to mount anything from the dracut hooks | ||
Before=dracut-initqueue.service | ||
|
||
#do not run, if there is no configuration | ||
ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/* | ||
ConditionPathExistsGlob=|/run/NetworkManager/system-connections/* | ||
ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/* | ||
ConditionPathExistsGlob=|/etc/sysconfig/network-scripts/ifcfg-* | ||
|
||
[Service] | ||
#run the script and wait before it finishes | ||
Type=oneshot | ||
ExecStart=/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon | ||
|
||
[Install] | ||
WantedBy=initrd.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters