[ solved ] Add program to startup

Home Forums GeeXboX on ARM SoCs [ solved ] Add program to startup

This topic contains 9 replies, has 3 voices, and was last updated by  tomlohave 11 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #6004

    geexbldr0
    Participant

    Hello:

    I’m using version 3 on the Cubox and would like to add an application for startup when the system boots. (Squeezeslave binary).  Given this is an optimized build, I’m not seeing locations I would normally add a startup script, for example /etc/init.d or /etc/rc.init, etc.

    Where might I add such a script?

     

    Thank You,

     

    • This topic was modified 11 months ago by  tomlohave. Reason: solved
    #6009

    tomlohave
    Keymaster

    we use systemd.

    look in /lib/systemd/system for services to start at boot

    #6014

    geexbldr0
    Participant

    Great, thank you.

    #11998

    togath
    Participant

    I want to run ‘ethtool’ during startup to limit the ‘eth0’ speed to 100MBit of Cubox-i.

    Exceuting the command “ethtool -s eth0 speed 100 duplex full” in the shell sets the speed appropriately.

    So I created a new file named ‘ethtool.service’ with that content:

    [Unit]
    Description=Set 'eth0' speed to 100MBit due to USB limitation
    After=kodi.service
    
    [Service]
    ExecStart=/usr/sbin/ethtool -s eth0 speed 100 duplex full
    
    [Install]
    WantedBy=default.target
    

    But the speed is not changed it always stays after startup at 1000MBit
    Tried to change ‘WantedBy’ to ‘network-online.service’ or ‘kodi.service’ didn’t change anything.

    • This reply was modified 11 months ago by  togath.
    • This reply was modified 11 months ago by  togath.
    #12003

    tomlohave
    Keymaster

    and what returns
    systemctl status ethtool.service ?

    #12004

    togath
    Participant
    root@geexbox:~# systemctl status ethtool.service
    ● ethtool.service - Set CuBox-i to 100 MBit due to USB-briding
       Loaded: loaded (/usr/lib/systemd/system/ethtool.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
    

    Do I need to register ‘ethtool’ as a service?

    • This reply was modified 11 months ago by  togath.
    #12008

    togath
    Participant
    [Service]
    ExecStart=/usr/sbin/ethtool -s eth0 speed 100 duplex full

    Ok, Im closing in on the problem: sytemctl does not like to pass parametes to a programme.
    Therefore I tried to refer to a shell script instead of calling ethtool directly:

    [Service]
    ExecStart=/root/setEth0.sh

    Nevertheless execution of the shell script keeps failing.

    I will keep you updated….

    #12009

    tomlohave
    Keymaster

    did you enable the service ?
    systemctl enable ethtool

    #12011

    togath
    Participant

    Thanks Tom,

    found it out 15 minutes ago, that ‘enable’ was missing 😀
    Now CuBox-i is set to 100MBit ever startup.

    Great, thaks for your help

    #12012

    tomlohave
    Keymaster

    ok, closing

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.