Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Add Pre and Post Hooks for /scripts/restartsrv_* Scripts

Ricky Grassmuck shared this idea 8 years ago
Open Discussion

As a server administrator I would like cPanel to add Pre- and Post- hooks for service restarts to allow integrators and advanced users to trigger actions around service restarts.


----------------------

This could be implemented either using the Manage Hooks feature in WHM or by the creation of a script following a predetermined naming scheme like the examples below.


Pre service restart script examples:

  • /scripts/pre_restartsrv_httpd
  • /scripts/pre_restartsrv_mysqld


Post service restart script examples

  • /scripts/post_restartsrv_httpd
  • /scripts/post_restartsrv_mysqld


The idea here obviously is that simply having the scripts present will lead to them being invoked when the corresponding restartsrv script is run.


Regardless of the method used to implement this functionality it's important that cPanel give it's more advanced users and developers the ability to properly manage the events that need to occur when starting, stopping and restarting services.

Leave a Comment
 
Attach a file