I want a script X.sh to switch users and perform an action, but so far I have this:
#!/bin/sh
sudo su partner -s /bin/bash
supervisord -c ~/supervisord.conf
exit
I want that the user partner execute supervisord and exit, but all I get is a switched user in the comand line a bash shell, doing the su partner -s /bin/bash
is the only way in which I can access the partner user.
Please Help
sudo su partner -c supervisord
? – Rmano Apr 16 '14 at 22:39sudo su partner -s /bin/bash -c 'supervisord -c ~/supervisord.conf'
That is assuming~/supervisord.conf
is in fact in the partner user's home directory. – ptierno Apr 16 '14 at 22:53