1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Event Manager not called by API

Discussion in 'Plesk for Linux - 8.x and Older' started by b-nut, May 12, 2005.

  1. b-nut

    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!
  2. nima

    nima Guest

    Did you have any answer about this problem ?
  3. b-nut

    b-nut Guest

    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.
  4. nima

    nima Guest

    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.
  5. dm__@

    dm__@ Guest

    Problem seems to be fixed in 7.5.4 beta
  6. jamesyeeoc

    jamesyeeoc Guest

    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.
  7. nima

    nima Guest

    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 ?

  8. dm__@

    dm__@ Guest

    Yes, it will break upgrade. And about calling psa-domain.sh:

    will do the trick.
  9. nima

    nima Guest

    thanks !
    I'll try it.