[0.94.0] own commands in extcommands.xml not working anymore

Hi
I updatet my server to version 0.94.0. In the past I added some commands to the extcommands.xml to control my lights at the printer. E.g.:

        <command>
                <name>Licht Ein</name>
                <execute>/home/pi/scripts/lighton.sh</execute>
                <!-- Define if command should show up in local printer interface, default true.-->
                <local>true</local>
                <!-- Define if command should show up in remote printer interface, default true.-->
                <remote>true</remote>
                <!-- Define if command should show up only for users with print permission, default true.-->
                <print-permission>true</print-permission>
                <!-- Define if command should show up only for users with add files permission, default false.-->
                <add-permission>true</add-permission>
                <!-- Define if command should show up only for users with del files permission, default false.-->
                <del-permission>true</del-permission>
                <!-- Define if command should show up only for users with configuration permission, default false.-->
                <config-permission>true</config-permission>
        </command>

After the update this commands do not work anymore. The entries are shown in the menu but executing them will not work. If I manually execute the commands (e.g.: "pi@PrusaMK3:/var/lib/Repetier-Server/database $ /home/pi/scripts/lighton.sh") the commands are executed fine.

Other commands in the extcommands.xml, like the "Shutdown Server" and "Reboot Server" are still working as expected. As told the commands worked fine until I upgraded to version 0.94.0...

How can this be solved?

Thanks in advance

Alex 

Comments

  • Did you upgrade only server or also image?
    If you updated image - did you change permissions? If you want to test if a command runs from server side run it like this:
    sudo -u repetierserver fullPathToScript

    that way you simulate also problems comming from being run as user repetierserver, which I think is the source of your problem.
  • I made my update using the integrated update function through the web interface...

    I've tested the scripts with e.g. "sudo -u repetierserver /home/pi/scripts/lightoff.sh". This works fine.

    Any other ideas?
  • Look at server.log (downloadable in logs) for hints. Maybe it wrote something in log. Haven't changed how that works and you also say it is still working for shutdown so seems at least that it is tried to start them.
  • edited June 2020
    The log shows nothing about that. It seems that the command is not tried executed at all. Tomorrow I will add an additional script that will write some text in file or so to see what's happen... At the moment I'm running out of ideas...
  • BTW: How do you control the lights? If it is a web command you can use the new web actions instead.
  • Ok. I will try that. Because with the standard "extcommands.xml" it will not work anymore...
  • BigAl said:
    Ok. I will try that. Because with the standard "extcommands.xml" it will not work anymore...
    Mist. Das ist auch keine Option. Ich will ja nur einen GPIO am Pi ein- bzw. ausschalten...
  • Ok hab mal selber getestet. Exact deine erweiterung für extcommands.xml und dann

    mkdir scripts

    chmod 777 scripts

    cd scripts/

    Dann lighton.sh erzeugt mit Inhalt:

    #!/bin/bash

    echo $(date) >> /tmp/light.log


    Dann weiter

    chmod 755 lighton.sh 

    sudo service RepetierServer restart

    Danach hatte ich den Menüpunkt drin und ein aufruf von Licht Ein hat die Datei /tmp/light.log erzeugt und eine Zeile mit der aktuellen Zeit eingefügt. Die Zeile kannst du auch zu testzwecken bei dir einfügen. Kann ja sein das die Datei aufgerufen wird aber dann Probleme hat. Im log gab es in der tat keinen Eintrag über die Befehlsausführung das ist also korrekt.



  • Ok. Danke. Werd's testen.
  • Die Zeile "#!/bin/bash" hatte ich nicht drin. Wenn ich die ins Script rein mache geht es. Die war aber noch nie drin. Dann brauche ich die zukünftig...

    Vielen Dank nochmal für den tollen Support!
  • Wenn die fehlt muss man das script mit
    /bin/bash script
    aufrufen. # in der ersten Zeile teilt linux mit, mit welchem interpreter die Datei ausgeführt werden muss. Klappt aber nur wenn die Datei ausführbar ist.
Sign In or Register to comment.