0

My goal is to run sudo inside one of the programs:

[program:doStaff]
command=sudo python manage.py doStaff
autostart=true
autorestart=true
stderr_logfile=/var/log/doStaff.err.log
stdout_logfile=/var/log/doStaff.out.log

Here is [unix_http_server] from supervisord.conf:

[unix_http_server]
file=/var/run/supervisor.sock  
chmod=0770   

Tried to set the supervisord user to root inside supervisord.conf but it didn't help.

I am trying to run this process as root since this script deletes some files in the system.

0

You should setup passwordless sudo for a user and run your script as that user.

Edit sudoers file first :

sudo visudo

At the end of that file add:

scriptrunner ALL=(ALL) NOPASSWD:ALL

Now run your script as scriptrunner user. You have to create that user of course.

0

In your program config (program:doStaff) add this line:

user=root

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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