I am using portia (https://github.com/scrapinghub/portia) and I have set the following command in my rc.local:
cd /home/portia/portia/slyd && twistd slyd
Problem here is that the command/script get executed as root and all the files/folders that are created by the script have "root" as owner.
How can I run this specific command as a different user?
What I have tried so far:
cd /home/portia/portia/slyd && su jim -c twistd slyd
cd /home/portia/portia/slyd && su jim -c "twistd slyd"
su jim -c "cd /home/portia/portia/slyd && twistd slyd"
Nothing worked.
I am running Ubuntu 12.04 LTS Server.
Thank you!
sudo -u jim "cd /home/portia/portia/slyd && twistd slyd"
and different variations with and without quotes without success.twistd
command does not run when invoked viasu
, or that it runs but the resulting files are still owned by root?cd /home/portia/portia/slyd && su jim -c "twistd slyd"
?