Issue with autostart.sh.

  • So i m trying to setup a command with autostart.sh

    command works fine..

    autostart.sh works fine...command executed..

    Command is for mounting an sshfs share remotely for recordings which also works fine..

    My issue is that this Rpi is only used as a TvHeadend server and had kodi always disabled and do everything I need trough SSH..

    Kodi is disabled by the kodi.service in .config system.d

    Problem is that when kodi is disabled,autostart won't work/start...

    Is there any way I can make autostart.sh work without kodi running...

    Or does it makes sense if I let kodi start normally...autostart.sh executed and add stop kodi to autostart after my mount command?

    Thanks


    Well I answered my own question...so let kodi start and run autostart and then stop kodi works fine..

    Still can't understand why autostart.sh needs kodi.service to work...

    Maybe someone can shed some light?

    Edited once, last by Mario77: Merged a post created by Mario77 into this post. (November 19, 2020 at 10:19 AM).

  • Interesting, kodi-autostart.service seems to be pulled in by kodi.service, not kodi.target (which is a bit unusual...).

    To get it back with kodi.service mask the following command should to the trick:

    Code
    systemctl add-wants kodi.target kodi-autostart.service

    For filesystem mounts it's better though to use mount units, see eg the nfs/cifs mount samples in .config/system.d and the mount unit documentation systemd.mount

    If this filesystem is used for tvheadend recordings I strongly recommend ordering the mount unit before service.tvheadend42.service so the filesystem will be mounted before tvheadend is started.

    so long,

    Hias

  • Thanks for your quick help..

    That trick worked nicely and autostart works fine now..

    Regarding the mount I have tried before to mount it via system.d but was having no success whatsoever and just gave up and went down the easy way..

    This is not a normal mount but an sshfs mount which is 2500km away...saying that it works fine through autosatart..so maybe I was doing something wrong although I was following a thread here and there where other people having issues..

    It is indeed used for tvheadend recordings but not directly...

    Recordings go on the server just in case there is a problem with the network...so if I loose connection for some reason to the box in the middle of a recording it wont be lost..after a recording is finished I made a script which runs comskip and then rsync recording to my country..after that the mount is used for TvHeadend api/dvr/entry/filemoved to edit TvH recordings logs to point to local hdd where the recordings are being moved..