1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    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

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

    nima Guest

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

    b-nut Guest

    0
     
    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

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

    dm__@ Guest

    0
     
    Problem seems to be fixed in 7.5.4 beta
     
  6. jamesyeeoc

    jamesyeeoc Guest

    0
     
    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

    0
     
    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.
     
  8. dm__@

    dm__@ Guest

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

    will do the trick.
     
  9. nima

    nima Guest

    0
     
    thanks !
    I'll try it.
     
Loading...