Plugin w/ root privileges

erohas

Verified User
Joined
Aug 5, 2007
Messages
40
Location
Kazakhstan, Almaty
How to enable something in plugin
to run any scripts that required root privileges
I plan to create a plugin that modify fastcgi dispatcher under User's home directory
commands : chattr, chmod, chown etc.
 
Its possible but you have to use a C wrapper. I never figured out how to do it. There is another thread here about it.

If somebody could provide so step by step instructions using simple script to create a file owned by root or read a file that only root can read that would be good and appreciated.

I don't even know what gets called from DA, the script I write or the wrapper.

I ended up writing to a queue file and having cron run it as root.
 
Last edited:
Its very much like the /usr/local/directadmin/data/task.queue. That is where I got the idea.

Just have the plugin write to the file what action needs to be taken and all the variables. Then have a script run from root's cron that reads the queue and determine what action needs to be taken and what the variables are.
 
Back
Top