Bug 917294 - Can't call "ctl_app" from a cron job. Getting "command not found"
Summary: Can't call "ctl_app" from a cron job. Getting "command not found"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-02 18:49 UTC by Nam Duong
Modified: 2015-05-14 23:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-04 16:49:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nam Duong 2013-03-02 18:49:29 UTC
Description of problem:
See https://openshift.redhat.com/community/forums/express/restart-jboss-with-cron

I was able to reproduce this by creating an app, adding cron, and a minutely job called foo.sh with:  
ctl_app restart  

In the cron log, I see:  
/var/lib/openshift/513245f25004468bb7000051/app-root/runtime/repo//.openshift/cron/minutely/foo.sh: line 1: ctl_app: command not found

Comment 1 Wei Sun 2013-03-04 06:35:35 UTC
Check this bug on INT(devenv_2886)

Step:
1.create an app,and add cron-1.4
2.add a minutely job called foo.sh with ctl_app restart

Result:

foo.sh: line 2: ctl_app: command not found

Additional info:
run ctl_app restart in my app,can not get above error message.
[cht-wsun3int.int.rhcloud.com cron]\> ctl_app restart
[cht-wsun3int.int.rhcloud.com cron]\>

Comment 2 Jhon Honce 2013-03-04 16:49:35 UTC
In you foo.sh script, add the line 'source /usr/bin/rhcsh' before using 'ctl_app'.


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