[Catalyst] Apache, Catalyst and executing commands that need root permission

Adam Jacob adam at stalecoffee.org
Tue Apr 25 20:04:19 CEST 2006

On Apr 25, 2006, at 2:55 AM, Gavin Henry wrote:

> Dear All,
> I know lots of you will have needed to do something similar, but what
> would you advise on the best way to execute commands that need root  
> access?
> I only need to be able to create a home directory and run one other  
> command.
> Use sudo?

I think using sudo's specificity is probably the only way to achieve  
this, short of just running as root... assuming you need to run in  
real time.

If you can handle a bit of a delay, you can always have a cronjob  
running in the background every so often that scans a table for  
things like this and then runs them.

Something like:

www-data         mybox = (root) /usr/local/bin/homedircreate.sh

Where homedircreate.sh handles the actual creation of the home  
directory.. mkdir, chown/chmod, copying /etc/skel, et al.


More information about the Catalyst mailing list