Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    custom.sh problems (again!)

    Recalbox General
    custom.sh again
    2
    7
    2216
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stigzler
      stigzler last edited by

      Hi folks,

      Since new update, this function appears to be broken again... 😞

      I have recalbox pointing to a a usb3 drive as the main drive. On it, under shares/system, I have the script "custom.sh":

      #!/bin/bash
      echo "Starting Cutom.sh"
      recallog "Starting FANCONTROL"
      python fanControl.py
      

      fanControl.py runs a fan script.

      if I explore the log, it shows that it IS automatically running the script:

      [       21.95] Starting S94manager
      [       22.14] ... Starting manager v2
      [       22.39] Starting pm2
      [      844.02] Starting FANCONTROL
      [      939.45] Starting FANCONTROL
      [      969.53] Stopping Emulationstation
      [      969.53] Stopping Emulationstation
      

      However, the fan doesn't run.

      If I putty in and run via:

      ./custom.sh
      

      it does run!

      So - what's going on here!?

      1 Reply Last reply Reply Quote 0
      • stigzler
        stigzler last edited by

        UPDATE:
        updated my script to:

        #!/bin/bash
        echo "Starting Cutom.sh"
        recallog "Starting FANCONTROL"
        recallog "Current Directory: " 
        recallog $PWD
        /usr/bin/python /recalbox/share/system/fanControl.py
        

        Still no joy. 😞
        Weird log, though:

        [ 22.45] ... Starting manager v2
        [ 22.66] Starting pm2
        [ 106.81] Starting FANCONTROL
        [ 106.83] Current Directory:
        [ 106.85] /recalbox/share/system
        [ 157.25] Starting FANCONTROL
        [ 157.28] Current Directory:
        [ 157.37] /recalbox/share/system
        [ 179.70] Starting FANCONTROL
        [ 179.72] Current Directory:
        [ 179.74] /
        [ 6.91] No need to upgrade configuration files

        1 Reply Last reply Reply Quote 0
        • stigzler
          stigzler last edited by

          @Substring - hey fella - you helped with this last time - any ideas?

          Sorry to b*mp my own post, but desperately trying to get this recalbox setup so I can post it this weekend to a friend who lives in France for xmas!

          1 Reply Last reply Reply Quote 0
          • stigzler
            stigzler last edited by stigzler

            -.<
            nemmind. Sussed it:

            	#!/bin/bash
            	echo "Starting Cutom.sh"
            	recallog "Custom.sh called"
            	case "$1" in 
            	   start)  
            			 recallog "Start detected. Starting fan script"
            			/usr/bin/python /recalbox/share/system/fanControl.py	 
            			 ;;  
            	   stop)  
            			 recallog "Stop detected."
            			 ;;  
            	   restart|reload)  
            			 recallog "Restart|Reload detected"
            			 ;;  
            	   *)  
            			recallog "Other state detected..."
            	esac  
            
            	exit $?
            
            Substring 1 Reply Last reply Reply Quote 0
            • Substring
              Substring @stigzler last edited by

              @stigzler if the recallog works fine but bot the python script, i'd have a look at the script

              On the other hand if your customs.sh works on commandline, looks line an environment problem.

              Anyway, you should a annampersand & at the end oh hour python command line, no need to hold init because of your script

              Former dev - Please reply with @substring so that i am notified when you answer me
              Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

              1 Reply Last reply Reply Quote 0
              • stigzler
                stigzler last edited by

                thanks @Substring , but the most recent code appears to work fine. NOt sure what you mean about the ampersand, but hopefully won't need it as so far so good!

                Substring 1 Reply Last reply Reply Quote 0
                • Substring
                  Substring @stigzler last edited by

                  @stigzler I mean /usr/bin/python /recalbox/share/system/fanControl.py & so that the process goes to background in multiprocessing. Otherwise you just lock the init script and never give the hand back.

                  What is your python script ? you should, for debug, run your script in custom.sh like /usr/bin/python /recalbox/share/system/fanControl.py 2>&1 | recallog & and see what the recalbox.log mentions

                  Former dev - Please reply with @substring so that i am notified when you answer me
                  Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post

                  Want to support us ?

                  63
                  Online

                  99.6k
                  Users

                  28.1k
                  Topics

                  187.1k
                  Posts

                  Copyright © 2021 recalbox.com