Results 1 to 8 of 8

Thread: Need to run a command at boot pre KDE

  1. #1
    Join Date
    Nov 2008
    Location
    Denmark
    Posts
    45

    Default Need to run a command at boot pre KDE

    Hi there,

    Due to a unsolved jme driver issue with my wired network adapter, I have to run a command after each boot and login to KDE in Tumbleweed. (see thread https://forums.opensuse.org/showthre...ted-Tumbleweed)
    I would love to have this command:

    Code:
    sudo /usr/sbin/ethtool -s enp2s0f5 speed 100 duplex full
    to run as root pre KDE, so that everything including mounting remote network drives is up and running before I or other users login
    .
    But how do I do that in a simple way. I have tried to lookup several - for me - rather complicated scrips, so I hope someone can explain me this in a basic way or point me in the right direction.

    Thank You in advance, Søren

  2. #2

    Default AW: Need to run a command at boot pre KDE

    I would use a udev rule for that.

    Create the file

    /etc/udevrules.d/99-my_enp2s0f5.rules

    containing

    Code:
    ACTION=="add|change", SUBSYSTEM=="net", KERNEL=="enp2s0f5", RUN+="/usr/sbin/ethtool -s %k speed 100 duplex full"
    and unload/reload the respective kernel module or reboot.

    AK

  3. #3

    Default AW: Need to run a command at boot pre KDE

    Quote Originally Posted by Akoellh View Post
    Create the file

    /etc/udevrules.d/99-my_enp2s0f5.rules
    *ARGH*

    Correction, make that file name:

    /etc/udev/rules.d/99-my_enp2s0f5.rules

    AK

  4. #4
    Join Date
    Nov 2008
    Location
    Denmark
    Posts
    45

    Default Re: Need to run a command at boot pre KDE

    Hi AK,

    Thank You for Your help and suggestion. Unfortunately it will not work - neither with wicked network management or network manager.
    When I look at the output in boot.log it seems that the boot process stalls at finding the network interface.

    In the /etc/udev/rules.d folder another - but empty - network related file is created at every boot called "70-persistent-net.rules".

    So I am still wondering what to do.

    Rgds Soren

  5. #5

    Default Re: Need to run a command at boot pre KDE

    • You could make a systemd service for it and then enable that so that it runs everytime the system boots up
    • You could put your command into a script that is run by your Display Manager

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,371
    Blog Entries
    1

    Default Re: Need to run a command at boot pre KDE

    For wicked, you can add the following option in your ifcfg-* config file
    Code:
    ETHTOOL_OPTIONS=’autoneg off speed 100 duplex full’
    Refer man ifcfg
    ETHTOOL_OPTIONS [ suffix ]
    If this variable is not empty, wicked will set these options on an ethernet type device. See the ethtool (8) manual page for
    available options. If the option string starts with a '-' (e.g. '-K iface rx on'), then the second word in the string will be
    replaced with the current interface name. Otherwise (e.g. 'autoneg off speed 10') ifup prepends '-s <interface>'. The
    optional variable suffix can be used to apply every setting separately, e.g.:

    ETHTOOL_OPTIONS='autoneg off speed 10'
    ETHTOOL_OPTIONS_gro='-K iface gro off'
    ETHTOOL_OPTIONS_lro='-K iface lro off'

    The NIC driver may reject settings as not supported (e.g. '-K iface lro off') or also when the link is not up.
    For NetworkManager, create a dispatcher script with the ethtool command.

  7. #7
    Join Date
    Nov 2008
    Location
    Denmark
    Posts
    45

    Default Re: Need to run a command at boot pre KDE

    Thank You.
    I changed to wicked and added the ETHTOOL OPTION to the config file and it works perfectly.
    Thanks

  8. #8
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,371
    Blog Entries
    1

    Default Re: Need to run a command at boot pre KDE

    Quote Originally Posted by Tarp View Post
    Thank You.
    I changed to wicked and added the ETHTOOL OPTION to the config file and it works perfectly.
    Thanks
    Glad to have been of help.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •