[0.94.0] own commands in extcommands.xml not working anymore
in Bug Reports
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.:
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
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
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've tested the scripts with e.g. "sudo -u repetierserver /home/pi/scripts/lightoff.sh". This works fine.
Any other ideas?
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.
Vielen Dank nochmal für den tollen Support!
/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.