[erlang-questions] Changing HEART_COMMAND on the fly

Yogish Baliga <>
Mon Jan 25 18:12:31 CET 2010

Hello Scott,

   When a erlang process dies, heart monitor start a new process using HEART_COMMAND and kill itself. So a new "heart" process is spawned. Assuming that your HEART_COMMAND is a shell script, you have to change the HEART_COMMAND in the shell script.

-- baliga
"Point of view is worth 80 IQ points" --Alan Kay


From: Scott Brooks <>
To: "" <>
Sent: Mon, January 25, 2010 7:50:27 AM
Subject: [erlang-questions] Changing HEART_COMMAND on the fly

We have a system in production using heart to monitor it.

We have a bug in our startup scripts that we want to fix, but we don't want to take down the running node.

Using heart:set_cmd(NewCmd) and then killing the existing server, I can get it to startup successfully with the new command, but unfortunately it retains the existing HEART_COMMAND environment variable, and so when the new node starts up, and I check heart:get_cmd().  It returns the old command.

I tried a os:putenv(HEAT_COMMAND, NewCmd), and that looks like it adjusts the existing nodes environment fine, but since heart is what restarts the erlang node, it's using the HEART_COMMAND as it exists for the heart process, not the erlang node environment.

I also tried killing off heart so I could restart it with a new environment, but that takes down the existing node.

Any thoughts as to how we can accomplish this?


Scott Brooks
Web Developer
Epic Advertising - New York, Toronto, San Francisco, London
60 Columbia Way, Suite 310
Markham, ON L3R 0C9
(905) 946-0300 x2356 - phone
(888) 666-3120 - fax

erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

More information about the erlang-questions mailing list