FS#31838 - [ethtool] systemd service support
Attached to Project:
Arch Linux
Opened by Ivan Lyapunov (dront78) - Monday, 08 October 2012, 04:44 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Tuesday, 29 March 2016, 02:00 GMT
Opened by Ivan Lyapunov (dront78) - Monday, 08 October 2012, 04:44 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Tuesday, 29 March 2016, 02:00 GMT
|
Details
Description:
It's good to enable systemd service support for ethtool to run after network startup since there is a lot of cases for this situation. So a little bit automatization with a config file would be good for all of them ;) |
This task depends upon
Closed by Gerardo Exequiel Pozzi (djgera)
Tuesday, 29 March 2016, 02:00 GMT
Reason for closing: Upstream
Additional comments about closing: See https://bugs.archlinux.org/task/31838#co mment130824
Tuesday, 29 March 2016, 02:00 GMT
Reason for closing: Upstream
Additional comments about closing: See https://bugs.archlinux.org/task/31838#co mment130824
[Unit]
Description=Ethtool configuration for %i
[Service]
EnvironmentFile=/etc/conf.d/ethtool.conf
Requires=network.target
After=network.target
ExecStart=/usr/sbin/ethtool -s %i $ETHTOOL_ARGS
Type=oneshot
[Install]
WantedBy=multi-user.target
ethtool config file /etc/conf.d/ethtool.conf
ETHTOOL_ARGS=""
usage sample
systemctl enable ethtool@eth0
Due to a network hardware bug I need to call ethtool like this:
/usr/sbin/ethtool --features eth0 tso off
The command "/usr/sbin/ethtool -s eth0 --features tso off" does not work, it has to be "/usr/sbin/ethtool --features eth0 tso off".
However it is not a big deal. I currently use a service file that invokes ethtool the way my network adapter requires it.
I checked and it works correctly
EnvironmentFile=/etc/conf.d/ethtool@%i.conf
ExecStart=/usr/sbin/ethtool $ETHTOOL_ARGS
So all people who require an arbitrary single call to ethtool will be able to use this solution.
I assume, interfaces which require more than one call to ethtool are rare.
you can make systemctl enable ethtool@abc, systemctl enable ethtool@cde etc every with own config file
because of /etc/conf.d/ethtool@%i.conf, so multiple calls on single iface is possible in this case
Maybe I should have looked up the meaning of %i earlier:
http://www.freedesktop.org/software/systemd/man/systemd.unit.html
So hopefully your service file will soon be added to package ethtool.
Regards, Peter.
As far as I can see a [Link] section does not offer an option to disable TCP segmentation offload.
The proposed ethtool service isn't an appropriate way of doing it. For one thing, it applies the settings from a single configuration file to every interface it has been enabled for. Using the /etc/conf.d like this at all is deprecated in favour of overriding or extending units in /etc/systemd/system. It also lacks a dependency on the device that it's modifying - depending on network.target isn't enough.
You would be better off just using a udev rule if what you're doing isn't yet supported by link files. It will be one line and won't be racing with the device if it isn't used for network.target. There are ways to do it correctly with a unit file, but I don't see a way that would be sensible to ship in the package.