How do I run a script as sudo at boot time?
I need to run ethtool --offload <net> rx off to disable the annoying jme udp checksum error message.
How do I run a script as sudo at boot time?
I need to run ethtool --offload <net> rx off to disable the annoying jme udp checksum error message.
You can create a systemd service.
Create a file /etc/systemd/system/ethtool.service:
[Unit]
Description=ethtool script
[Service]
ExecStart=/path/to/yourscript.sh
[Install]
WantedBy=multi-user.target
And script /path/to/yourscript.sh (don't forget to chmod +x it)
#!/bin/bash
ethtool --offload <net> rx off
Enable your service
systemctl enable ethtool
It will run on boot as root.
Put your commands in /etc/rc.local or create that file if it does not exist:
touch /etc/rc.local
chmod +x /etc/rc.local
All these actions have to be done as root.