[SOLVED][Deepin 15.4] Disable energy efficient ethernet at boot
Tofloor
poster avatar
danygee
deepin
2017-07-31 14:34
Author
Edited by danygee at 2017-7-31 14:57

Hi,
in other distros like Mint or Elementary I use /etc/rc.local file to disable EEE on my interface:
        ethtool --set-eee enp0s31f6 eee off
        exit 0

In Deepin I cannot find this file.

How can I disable EEE at boot in Deepin?
This command requires root to work:
sudo ethtool --set-eee enp0s31f6 eee off
Reply Favorite View the author
All Replies
nipos
deepin
2017-07-31 22:29
#1
The ethtool command is provided by a package named ethtool  which you can install on Deepin,too.
Unluckily Deepin doesn't provide an online package index so I can't find out if it is in the official repositories.
I found it here for Arch,but that will only help you if you want to compile it yourself:
https://www.archlinux.de/?page=P ... _64;pkgname=ethtool
You can simply try "apt-get install ethtool" first,hopefully it is in the repositories.
If not,you could add Debian repositories if it is in there what I don't know too.
Reply View the author
danygee
deepin
2017-07-31 22:47
#2
Edited by danygee at 2017-7-31 20:03
https://bbs.deepin.org/post/143496
The ethtool command is provided by a package named ethtool  which you can install on Deepin,too.
Unl ...

Thx, but that was something I alredy knew


The trick was to run the script as a systemd service
Here is how:
Make sure your script (I named mine eee_off) is executable and the first line (the shebang) is #!/bin/sh.
=====================
#!/bin/sh
sudo ethtool --set-eee enp0s31f6 eee off
=====================
Place the script where you want (in my case it was /usr/bin/)

Then create the .service file in /etc/systemd/system (a plain text file, let's call it eee_off.service):
=====================
[Unit]
Description=Turn off EEE on interface

[Service]
Type=oneshot
ExecStart=/usr/bin/eee_off

[Install]
WantedBy=multi-user.target
=====================

Once you're done with the files, enable the service:
=====================
systemctl enable eee_off.service
=====================

It should start automatically after rebooting the machine. In my case it did.
You can check it by typing this in terminal: sudo systemctl status eee_off.service
=====================
● eee_off.service - Turn off EEE on interface
   Loaded: loaded (/etc/systemd/system/eee_off.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2017-07-31 08:30:45 CEST; 14min ago
  Process: 570 ExecStart=/usr/bin/eee_off (code=exited, status=0/SUCCESS)
Main PID: 570 (code=exited, status=0/SUCCESS)

lip 31 08:30:45 linuxlab3 systemd[1]: Starting Turn off EEE on interface...
lip 31 08:30:45 linuxlab3 sudo[578]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/ethtool --set-eee enp0s31f6 e
lip 31 08:30:45 linuxlab3 sudo[578]: pam_unix(sudo:session): session opened for user root by (uid=0)
lip 31 08:30:45 linuxlab3 sudo[578]: pam_unix(sudo:session): session closed for user root
lip 31 08:30:45 linuxlab3 systemd[1]: Started Turn off EEE on interface.
=====================








Reply View the author