0

I've created a startup script in bash that calls a Python script. However when I run "sudo sh StartUpScript.sh" from the command prompt it says:

"Sorry, user root is not allowed to execute '/usr/bin/python3 /home/pi/python Indoor-Air-Quality-MQTT.py' as root on user1.

I'm logged on as a user called remoteuser and I've given remoteuser full privilege in sudoers.

remoteuser ALL=(ALL:ALL) AL

Any ideas how ti can get this script to run?

closed as off-topic by Milliways, techraf, SlySven, Darth Vader Dec 23 '17 at 10:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Milliways, techraf, SlySven, Darth Vader
If this question can be reworded to fit the rules in the help center, please edit the question.

  • To be honest this is more of a U&L SE question... – SlySven Dec 22 '17 at 4:36
1

The path shown does not look correct:

/home/pi/python Indoor-Air-Quality-MQTT.py

Looks like it should be:

/home/pi/python/Indoor-Air-Quality-MQTT.py

(notice the / between python and Indoor)

From the now-deleted answer:

ls -l "/home/pi/python Indoor-Air-Quality-MQTT.py"

  1. Verify the permissions of the python script.
  2. Verify the python script is executable.

ls -ld "home/pi/python"

  1. Verify the permissions of the directory containing the script.

The post also suggested adding an entry to /etc/sudoers to remove the need to run as root.

Not the answer you're looking for? Browse other questions tagged or ask your own question.