Posts Tagged ‘bash’
Running Commands as Another User in a Script
There’s plenty of situations where you need to to open a shell to run something as a different user within a script. Scripts like the Zimbra start-stop scripts can’t be run using sudo (Honestly, I don’t know why and haven’t questioned it). For my script, the root user doesn’t have the zmcontrol utility in its path, so it had to actually spawn a shell as the zimbra user to run. Since it wasn’t terribly obvious after a few minutes of googling, I decided to post how I did it. My example uses the zmcontrol utility which has to be run as the zimbra user:
su -l -c "zmcontrol start" zimbra
- Zimbra Releases Package for Ubuntu 8.04 Everyone's favorite collaboration suite, Zimbra, released its newest version 5.0.9...
- Fog Computing Cloud computing and virtualization has been all the hype over...
- 10 Tips for Success in Tech Support While most people don't think of a technical support position...
- Stallman Rips Cloud Computing GNU and Free Software Foundation founder Richard Stallman last week...
- What is a Plug in Hybrid Electric Vehicle? A PHEV (Plug in Hybrid Electric Vehicle) is a vehicle...
- The Runner’s Nod The run. Making the commitment to get outside and go...
- Review of WordPress Plugin Development One of the most well known publishers around the globe...
Tags: bash, linux
Filed under Tech Trends :
Comments (0) :
Jul 2nd, 2009


