how to develop my own plugin to directadmin?

eltercerhombre

New member
Joined
Sep 15, 2008
Messages
2
Hello,

i need develop my own plugin to integrate a new service in directadmin. Is there any guide, howto or example of how to develop plugins for directadmin.

thank you.
 
The plugin should read root/admin files and modify them fine. Maybe chmod 666 or 777?
 
Probably not a good idea to chmod 666 the /etc/shadow file. That is just one example.

Maybe I should have been more explicit. I want to be able to develop a plugin that will be able to modify a number of system configuration files.

I have read something about using a wrapper but I have no idea how to write one or one is available already or if I am even on the right track.
 
So does the script I write somehow call the wrapper? What does the wrapper do exactly?
 
A compiled C binary file is not a script. The wrapper is to be executed with root permission, so you can modify the system configuration file.
 
A compiled C binary file is not a script. The wrapper is to be executed with root permission, so you can modify the system configuration file.

That much I know. I am trying to figure out how to write and implement a wrapper to do what I need to do.

If there is a step by step guide please send me the link and I will read it.
 
Here is an example:
Code:
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>

int main(int argc, char *argv[])
{
	setuid(0);
	setgid(0);

	// do the things you want
}
 
So basically any actions I want done have to be done in C. It cannot be done in php or perl.
 
That's what we did for our plugins. But i think its possible to run external php/perl scripts as root via the C wrapper.
 
What I did was have my perl script write the actions to a queue file and then have a cron job running as root run a script that reads the queue file and then does whatever needs to be done. Much like dataskq.
 
What I did was have my perl script write the actions to a queue file and then have a cron job running as root run a script that reads the queue file and then does whatever needs to be done. Much like dataskq.

It's ok if the tasks do not need to be executed immediately.
 
I cannot think of anything that would need to be done immediately. After all it wasn't done up until the time I told the plugin to do it. Surely it can wait 1 more minute.
 
Back
Top