[systemd-devel] [PATCH] rules: only run systemd-sysctl when a network device is added

Reindl Harald h.reindl at thelounge.net
Sun Jun 16 15:08:43 PDT 2013



Am 16.06.2013 23:58, schrieb Ross Lagerwall:
>> The problem Zbigniew describes is that if one adds config options with
>> predictable network names used, and we do not apply the stuff at
>> "move", we will never apply them.
>>
> OK, thanks.  But my testing shows otherwise: I created a .conf file with:
> net.ipv4.conf.enp1s0.forwarding=1
> (where eth0 is the old name, enp1s0 is the new, predictable name)
> It *correctly* sets /proc/sys/net/ipv4/conf/enp1s0/forwarding=1 after
> a reboot with the patch applied.
> 
> I'm still not clear about in which situations it could fail?

and because all this magic is too fragile at least since Fedora 18
i created a service which is started after network.service and since
them all my services and forwardings are working again as expected

[root at srv-rhsoft:~]$ cat /etc/systemd/system/sysctl-post-network.service
[Unit]
Description=apply settings after network
After=network.service openvpn.service hostapd.service network-wlan-bridge.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/sysctl -p
StandardOutput=null

[Install]
WantedBy=multi-user.target

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130617/e434b0d3/attachment.pgp>


More information about the systemd-devel mailing list