Running Commands as Another User in a Script
      by Wyatt WalterThere’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
- Microsoft Says No Deal to Yahoo Microsoft CEO Steve Ballmer made a public statement today stating...
- Why Would Microsoft Not Offer Windows 7 Ultimate? I just got done reading a post by Don Reisinger...
- Installing Multiple Instances of Zimbra Desktop in Linux Yahoo! Zimbra Desktop is almost reaching full release status, but...
- PHP Apps: Apache vs Nginx I've always read (and witnessed) that nginx is a far...
- Review of WordPress Plugin Development One of the most well known publishers around the globe...
- The Runner’s Nod The run. Making the commitment to get outside and go...
- What is a Plug in Hybrid Electric Vehicle? A PHEV (Plug in Hybrid Electric Vehicle) is a vehicle...
Tags: bash, linux
Filed under Tech Trends :
Comments (0) :
Jul 2nd, 2009


