Ian Winter Ian Winter

CF8 JRun init script error

Setting up a staging server environment which will run 3 instances of CF and looking to alter the init scripts so it fires them all up on boot. Took a look at the one the installer creates and thought simple enough to just put multiple calls in for each server instance. Oh no.

On our RHES4 platform we have CF starting up as the apache user, but, running the script causes a "This account is currently not available." error to be thrown because it has no shell and it's locked. After looking at another server running a server install I notice the issue is down to the su command issued.

JRun

su $RUNTIME_USER -c "$CF_DIR/bin/jrun -stop cfusion"
su $RUNTIME_USER -c "$CF_DIR/bin/jrun -start cfusion >& $CF_DIR/logs/cfusion-event.log &"

Server Install

su -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 &"

Key difference is the "-s /bin/sh" part. Altering my script to the following makes it work. Yay. Not sure if this a known bug of something funky in our setup, but, as it's a vanilla OS install I don't see what it could be.

su -s /bin/sh $RUNTIME_USER -c "$CF_DIR/bin/jrun -stop cfusion"
su -s /bin/sh $RUNTIME_USER -c "$CF_DIR/bin/jrun -start cfusion >& $CF_DIR/logs/cfusion-event.log &"

Comments

Steven Erat's Gravatar The multiserver init scripts clearly omitted to specify a shell, and depend on the RUNTIME user having a default shell. I would technically say this should be an enhancement request, not a bug per se, but feel free to drop a line to the ColdFusion wishlist.

You may want to replace the use of su with the runuser command instead, see this blog entry for why:

http://www.talkingtree.com/blog/index.cfm/2006/7/2...

Also, I once wrote some multiserver startup scripts for Linux before they were actually shipped with CF. I haven't tested them with CF8, but if you're having trouble sleeping then read on...

http://www.talkingtree.com/blog/index.cfm/2005/7/1...
# Posted By Steven Erat | 21/07/08 18:21
Ian's Gravatar Cheers for that Steven.
# Posted By Ian | 22/07/08 13:55

Powered by BlogCFC, 5.9.002. Contact Me

All comments, view, rants, raves and opinions are mine and mine alone.

del.icio.us Digg Flickr Last.fm LinkedIn Pownce Twitter YouTube