Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I send signals or events to a running Upstart job? I run a Node.js HTTP server with Upstart as a daemon and sometimes need to put it into maintenance mode for backups and stuff.

I'd like to send a signal to the node process, which then will response with the maintenance mode.

Can I do something like this? initctl sendsignal MyNodeDaemon maintenance

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Note currently, although we do plan to add such a feature. However, you can still do what you want using the status command. Something like:

pid=$(initctl status MyNodeDaemon | grep /running | awk '{print $NF}')
[ ! -z "$pid" ] && kill -SIGFOO $pid
share|improve this answer
    
usually awk does not require a grep to filter the input since there is a built in functionality for this in awk –  Istvan Jul 23 '12 at 16:35
    
If the daemon provides a CLI, would it be possible to send some CLI input to the daemon? –  silvinci Jul 27 '12 at 14:27
    
@jamesodhunt I see that it has been a year and a half since you wrote this. Is it still the case? I'd sure like to send SIGUSR1/2... –  voxobscuro Feb 7 at 17:09
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.