diff options
author | Simon Rettberg | 2014-01-29 21:10:04 +0100 |
---|---|---|
committer | Simon Rettberg | 2014-01-29 21:10:04 +0100 |
commit | b77ffba65617c4001e85a31dc9673d0abe481fb8 (patch) | |
tree | 40033a4e82cc9e8e3b13889c4aec3aa5f1acd3ee /remote/modules/dhcpc-busybox | |
parent | Merge branch 'master' of simonslx:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-b77ffba65617c4001e85a31dc9673d0abe481fb8.tar.gz tm-scripts-b77ffba65617c4001e85a31dc9673d0abe481fb8.tar.xz tm-scripts-b77ffba65617c4001e85a31dc9673d0abe481fb8.zip |
<stage32> Trigger network target as soon as possible if network/dhcp has been done in stage31
Diffstat (limited to 'remote/modules/dhcpc-busybox')
5 files changed, 12 insertions, 14 deletions
diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service new file mode 120000 index 00000000..a2e7487d --- /dev/null +++ b/remote/modules/dhcpc-busybox/data/etc/systemd/system/dhcpc@.service @@ -0,0 +1 @@ +udhcpc@.service
\ No newline at end of file diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service deleted file mode 120000 index dff66b14..00000000 --- a/remote/modules/dhcpc-busybox/data/etc/systemd/system/sysinit.target.wants/udhcpc@br0.service +++ /dev/null @@ -1 +0,0 @@ -../udhcpc@.service
\ No newline at end of file diff --git a/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service b/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service index 6547de5b..9226f00c 100644 --- a/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service +++ b/remote/modules/dhcpc-busybox/data/etc/systemd/system/udhcpc@.service @@ -1,7 +1,6 @@ [Unit] -Description=DHCP Client -DefaultDependencies=no -Before=sysinit.target +Description=DHCP Client for %i +After=systemd-tmpfiles-setup.service [Service] Type=forking @@ -9,5 +8,3 @@ PIDFile=/run/udhcpc/udhcpc.%I.pid ExecStart=/opt/openslx/scripts/systemd-udhcpc++ %I ExecStopPost=/bin/rm /run/udhcpc/udhcpc.%I.pid -[Install] -WantedBy=multi-user.target diff --git a/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf b/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf new file mode 100644 index 00000000..3f83df3b --- /dev/null +++ b/remote/modules/dhcpc-busybox/data/etc/tmpfiles.d/udhcpc.conf @@ -0,0 +1 @@ +D /run/udhcpc 0755 root root diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx index 546750b9..e43afb33 100755 --- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx +++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx @@ -20,12 +20,12 @@ . /opt/openslx/config RESOLV_CONF="/etc/resolv.conf" -THIS_RESOLV="/run/dhcpc/${interface}.resolv" +THIS_RESOLV="/run/network/${interface}.resolv" rebuild_resolv_conf () { # Maybe make this smarter some time, if anyone is using client's that are on multiple networks at once etc... # This is a little braindead but should work most of the time - sort -u /run/dhcpc/*.resolv > "$RESOLV_CONF" 2> /dev/null + sort -u /run/network/*.resolv > "$RESOLV_CONF" 2> /dev/null } escape_search() { @@ -96,7 +96,7 @@ case "$1" in sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config # Only if network is not ready yet - if [ ! -e "/run/dhcpc/network-ready" ]; then + if [ ! -e "/run/network/network-ready" ]; then # Update hostname if [ -z "$dns_host" ]; then # fallback to what the dhcp told us @@ -130,7 +130,7 @@ case "$1" in fi # Update /etc/issue for proper spacing /opt/openslx/scripts/openslx-create_issue - touch "/run/dhcpc/network-ready" + touch "/run/network/network-ready" # Mark network target as reached systemctl start network.target & fi # end "network not ready yet" @@ -158,16 +158,16 @@ case "$1" in sed -i -r '/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\s*$/d' /etc/hosts # "dns ready" target - if [ -n "$dns" ] && [ ! -e "/run/dhcpc/dns-ready" ]; then - touch "/run/dhcpc/dns-ready" + if [ -n "$dns" ] && [ ! -e "/run/network/dns-ready" ]; then + touch "/run/network/dns-ready" # Write to openslx-config echo "# Config written by openslx-dhcp-script (2)" >> /opt/openslx/config echo "SLX_DNS='$dns'" >> /opt/openslx/config systemctl start network-dns.target & fi # "default route exists" target - if [ -n "$router" ] && [ ! -e "/run/dhcpc/routing-ready" ]; then - touch "/run/dhcpc/routing-ready" + if [ -n "$router" ] && [ ! -e "/run/network/gateway-ready" ]; then + touch "/run/network/gateway-ready" # Write to openslx-config echo "# Config written by openslx-dhcp-script (3)" >> /opt/openslx/config echo "SLX_DNS='$dns'" >> /opt/openslx/config |