Hooks service

This function won't work well if the hook is a binary executable file, which may happen on *ix machines.