Steven Erat's Blog Steven Erat Photography
 
 
Viewing By Entry
 
 

TalkingTree  The init scripts cfmx7search or coldfusionmx7 hang the system when booting linux

 

Hans Omli recently presented the following problem to me:

I've run into an issue installing ColdFusion MX 7 on Red Hat Enterprise Linux 4 Update 2 or Update 3. The same issue doesn't occur on the original release of RHEL 4 or Update 1. The issue is that after restarting, linux pauses at 'Starting coldfusionmx7: ' until you press Enter, after which the boot process continues. Haven't been able to track down a workaround yet...

To be complete, the issue also appears on the original release and Update 1 of RHEL 4 after running up2date to apply available security updates. I think I've narrowed the issue down to the selinux-policy-targeted package. When I get a chance, I plan to diff selinux-policy-targeted-1.17.30-2.88 (RHEL4-U1) and selinux-policy-targeted-1.17.30-2.110 (RHEL4-U2) to figure out what change(s) may be causing the issue.

This was the fourth report I've heard of this problem, and until today I've never been able to reproduce it when using the original RHEL4 release. Hans provided the clue that it only occurred in recent updates to RHEL (or CentOS), so I downloaded CentOS 4.3 which has the updated SELINUX policy, and then installed ColdFusion 7.01 to let the fun begin.

The short answer and solution ...
Replace the use of the su command with the runuser command in the cfmx7search and coldfusionmx7 init scripts.

The long answer ...

The cfmx7search and coldfusionmx7 init scripts default to start in run levels 3-5 on Linux, and both of their scripts contain a su - nobody to change to the runtime user. The init script cfmx7search is scheduled to start before coldfusionmx7, so the problem has been observed mostly in cfmx7search because bootup never gets to coldfusionmx7. The problem is that during system startup when cfmx7search service starts, SELINUX (even in permissive mode) interactively prompts for a reply regarding the user role because cfmx7search script su's to another user. The command /sbin/su will not suppress any prompts that might occur. This causes cfmx7search startup to hang indefinitely while the su command waits for user input. A review of /var/log/messages has an audit trail containing a message like this:

cfmx7search: Do you want to choose a different one? [n]

This is only part of the interactive prompt, where the full message would be:

Your default context is user_u:system_r:unconfined_t.
   Do you want to choose a different one? [n]

If someone is at the console and quickly enters 'n' for both cfmx7search and coldfusionmx7 then both start up normally and the system completes boot. The command /sbin/runuser can be used in place of /sbin/su to suppress interactive prompts. Changing both start scripts to use runuser instead of su resolves the problem and allows the system to boot while starting all ColdFusion related services non-interactively. To resolve the problem, edit the cfmx7search and coldfusionmx7 init scripts. The following demonstrates where to use runuser:

/etc/init.d/cfmx7search:
Linux)
OS=Linux
platform=_ilnx21
SUCMD="runuser -s /bin/sh $RUNTIME_USER -c"


/etc/init.d/coldfusionmx7:
Linux)
OS=Linux
LD_LIBRARY_PATH="$CF_DIR/lib:$CF_DIR/lib/_ilnx21/bin"
CFSTART='runuser -s /bin/sh $RUNTIME_USER -c "export PATH=$PATH:$CF_DIR/runtime/bin; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; cd $CF_DIR/runtime/bin; nohup $CF_DIR/runtime/bin/cfmx7 -jar jrun.jar -autorestart -start coldfusion &"'
CFSTOP='runuser -s /bin/sh $RUNTIME_USER -c "env -i; cd $CF_DIR/runtime/bin; $CF_DIR/runtime/bin/cfmx7 -jar jrun.jar stop coldfusion"'

 


Comments

Sure enough, using runuser instead of su makes SELinux happy. Many thanks for tracking this down!


Stupid, stupid SELinux.
It's not like the prompt is even meaningful !


Maybe I did something wrong with my install, but I don't have a file at /etc/init.d/coldfusionmx7. I can start things manually just fine with /opt/coldfusionmx7/bin/coldfusion start.

Where do I find the service script so I can have cf start on boot?


Run {cf_root}/bin/cfmx-init.sh to install or remove the *nix init scripts for ColdFusion server configuration.


I checked in this fix for ColdFusion 8.0 Server Configuration back in 2007. At that time there was no boot script for Multiserver config. CF 8.01 introduced /etc/init.d/coldfusion8multi but did not include the fix that I made in /etc/init.d/coldfusion8 ( or {cfroot}/bin/coldfusion ). Therefore it has the same problem originally described here, if the runtime user (nobody) has no default shell assigned then starting coldfusion8multi as root will produce "This account is currently not available".

Modify the coldfusion8multi to user runuser instead of "su -" as shown in his entry to get around it.


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Search This Site

 
This is an exact search only

About This Site

 
I live west of Boston and work as a Software Engineer with ColdFusion and Flex, specializing in Linux. Recently I graduated in Professional Digital Photography from CDIA.
More about me

Recent Entries

 
A ColdFusion Trick for Lost D..
Starting ColdFusion9 Solr: Us..
Adobe LiveCycle DataServices ..

Recent Comments

 
Posted By Aaron Longnion:
Thanks Steven, I just ran into this problem, remembered your tweet about it, and found your blog on it. :)

Posted By srinyvas:
Hai, This information is very useful and i like your excellent writing skill. Can i copy this Content to my website top management colleges ...

Posted By Steven Erat:
@Wade - Glad I could help! Thanks for letting me know it worked for you too.

recently played

 
The Candid Frame #70 - Greg Gorman
by Ibarionex R. Perello
on The Candid Frame: A Photography Podcast

now playing, a plug-in for itunes

Categories

 
RSS Adobe (34)
RSS Bicycling (9)
RSS Blogging (39)
RSS Books (13)
RSS Breeze (13)
RSS CFMX Podcasts (10)
RSS ColdFusion (427)
RSS Computer Technology (51)
RSS Events (26)
RSS Flex (20)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (27)
RSS Meetup (35)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photography (111)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Twitter (10)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Terrence Ryan
Ben Forta
Ray Camden
Kinky Solutions
Dan Vega
Gary Gilbert
Simeon Bateman
Red Hat Blogs
O'Reilly Digital Media
O'Reilly Radar
John Nack
The Strobist
Scott Kelby
Matt Kloskowski
Joe McNally
Digital Photography School
Engadget
Science Blog

RSS

 


Add to Google
Add to My Yahoo!

Aggregated By

 


Consumed By Feed-Squirrel.com
Aggregated by ColdFusionBlogger.org

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software
CJM Group - ColdFusion Website Hosting


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2010 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer