Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to hook some script to shutting down sequence for Linux?

To give you a bit more context processes of nodes of the cluster are started as processes from cluster -master. They are not running as services. However if someone restart a node and didn't stop the appropriate process manually, it causes a troubles because the node hasn't been stopped gracefully.

I would like to avoid this situation. Processes they don't run as services.

share|improve this question
add comment

1 Answer

I'd link a script that would shut down the nodes to /etc/rc6.d

It'll run on runlevel 6, that coresponds to shutdown sequence. Link name should be of format KXXName, where XX is a sequence number.

I'm assuming here that you have control over the nodes and you are able to wait for them to shut down gracefully.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.