Steven Erat's Blog
 
 
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.


 

 

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 used to work at Adobe with ColdFusion and Flex, specializing in Unix & Linux. I recently graduated from CDIA in Pro Digital Photography. Curious about my banner image?

More about me

Recent Entries

 
Christmas Eve Service makes F..
How To Filter by File Type in..
Perspective on ColdFusion's B..
Power Mac G5: The lights are ..
My Application to CDIABU in R..

Recent Comments

 
Posted By Yvonne:
Clear video taken! I was looking for such a video through Google & it led me to yours. Wanted to show to my students through a video clip, the whol ...

Posted By Andy Allan:
Fantastic work Steve.

Posted By charlie arehart:
Oh wow, awesome to hear that the relative quiet was an imposed one, and that the gag order has been lifted. Now I'm really excited to hear what may co ...

recently played

 
Snap Judgments
by WNYC, New York Public Radio
on On The Media
On The Media, WNYC, New York Public Radio

now playing, a plug-in for itunes

Categories

 
RSS Adobe (31)
RSS Bicycling (9)
RSS Blogging (37)
RSS Books (13)
RSS Breeze (12)
RSS CFMX Podcasts (10)
RSS ColdFusion (420)
RSS Computer Technology (50)
RSS Events (25)
RSS Flash (3)
RSS Flex (18)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (28)
RSS Meetup (34)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photography (109)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Scrum Sucks
Ben Forta
Ray Camden
Kinky Solutions
Gary Gilbert
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 © 2009 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer