Bug 1021671 - pre_start_nodejs-0.10 action_hook does not fire on app restart
pre_start_nodejs-0.10 action_hook does not fire on app restart
Status: CLOSED NOTABUG
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jhon Honce
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-21 14:48 EDT by Corey Daley
Modified: 2015-05-14 19:31 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-21 15:05:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Daley 2013-10-21 14:48:34 EDT
Description of problem:
When using the pre_start_nodejs-0.10 action_hook to set an environment variable (such as NODE_ENV), on a nodejs cartridge, the environment variable is correctly set when creating the application, when doing a git push, or when doing an rhc app stop/rhc app start, but, when you do an rhc app restart, the script is not fired and the environment variable does not fire.  I'm not sure this is the intended result, as it makes no sense for that environment variable to disappear when you restart your application.  This also occurs if you restart your application from the web console.  I know that you can use the --env NODE_ENV=production when you create a gear from the command line, but this doesn't help when you use a web based quickstart.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  Create nodejs application and create a pre_start_nodejs-0.10 action_hook that sets an environment variable
2.  modify the code to show the environment variable on the screen when you go to the site you created
3.  deploy the application
4.  rhc app restart $appname, or restart from the web console

Actual results:
the environment variable will not be set after a restart

Expected results:
the environment variable should still exist (get re-set) when the app restarts, it should execute the pre_start_nodejs-0.10 action_hook since it is restarting the node server.

Additional info:
Comment 1 Jhon Honce 2013-10-21 15:05:43 EDT
Restart is a different code path in some cartridges than stop/start.  If you need pre_start called you can add a call to pre_start in pre_restart.

Note You need to log in before you can comment on or make changes to this bug.