User repetierserver has insufficient rights for executing a script
Hi together,
i am trying to execute a script as a printer command.
The script "Webcam.sh" is for focussing the webcam and contains:
i am trying to execute a script as a printer command.
The script "Webcam.sh" is for focussing the webcam and contains:
sudo v4l2-ctl --set-ctrl=focus_auto=0 sudo v4l2-ctl --set-ctrl=focus_absolute=55
As the user "raspberry" i can execute it with:
bash /home/pi/Webcam.sh
When i try it with:
sudo -u repetierserver bash /home/pi/Webcam.sh
i get the following response:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for repetierserver:
I have already tried to follow the instructions from the manual on how to add the user to sudoers, but didn't get it to work.
Do you have any solutions for me
(PS:Other scrips are working, so i don't think it's a mistake in my extcommands.xml file)
Thanks
Do you have any solutions for me
(PS:Other scrips are working, so i don't think it's a mistake in my extcommands.xml file)
Thanks
Comments
sudo /home/pi/Webcam.sh
assuming first line in script is
#!/bin/bash
and permissions 755. To start it with bash is again breaking sudoer since you are calling bash for sudo and not the script and you do not want bash in that list since that allows executing everything as root.
Simplest solution is to add this to /usr/local/Repetier-Setup/bin/mjpgStart at the end which starts the webcam in our image. It is run as root already.
In the long run I want it to automatically call a extra script for configuration depending on the port number so configs could be stored there as mjpgStart might get overwritten in future updates to add that function.
Thank you