• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Event Manager not called by API

B

b-nut

Guest
I'm using modernbill to automate account setup in plesk. There are some post-setup scripts that I have to run to complete the setup of my customers websites, but they have to run after the domain is set-up. I thought this would be a perfect opportunity to use the event manager to run these scripts after my custom skel was in place.

The problem is, the "Domain created" event is only run when the domain is created in the Plesk gui. It does not run when modernbill executes the Plesk API commands to add the new domain.

Is this the expected behavior? The documentation on this is sparse.

Anybody have a workaround for this?

Thanks for the help!
b-nut
 
I did not find a way to automatically fire the event when the domain is added to plesk through the API. The solution I used is a cron job that runs every 10 minutes to check for new domains. The post-install script is then run on all new domains. Not the most elegant solution but it works.
 
:(
I also wanted to do it without crons...
I'll try to find something else, as you said : "more elegant"... I'll tell you in case of succes.
Thanks.
 
Originally posted by nima
:(
I also wanted to do it without crons...
I'll try to find something else, as you said : "more elegant"... I'll tell you in case of succes.
Thanks.

Problem seems to be fixed in 7.5.4 beta
 
Maybe not 'elegant' either, but you could rename the domain.sh script to psa-domain.sh, then write your own 'domain.sh' which calls the psa-domain.sh then calls the post-install script for the new domain. (just a thought) Warning: may have to have your script determine if it is being called from ModernBill or the CP so it knows if it should run the post-install script or not.
 
Wow !
Looks to be a nice hack !
But I'm a little afraid about renaming plesk files as I really don't know what they do.
How can I know wich parameters are passed to the script.
If I rename the file domain.sh as you say and chain it with a new custom domain.sh script, how do I call the psa-domain.sh script from my custom script once mine is over ?

Will this break any upgrade of plesk ?

Thanks,
Nicolas.
 
Back
Top