Script Question (solved)
Mike McGrath
mmcgrath at iesabroad.org
Fri May 6 19:47:19 UTC 2005
> -----Original Message-----
> From: fedora-list-bounces at redhat.com
> [mailto:fedora-list-bounces at redhat.com] On Behalf Of Mike McGrath
> Sent: Friday, May 06, 2005 1:25 PM
> To: For users of Fedora Core releases
> Subject: Script Question
>
> I've got a publishing script for some users to publish a
> couple of java apps onto a test server. The end of the
> script looks like this:
>
> ## RESTART_TOMCAT gets set to 1 earlier on in the script....
> ----------------------------------------------------------
> if [ $RESTART_TOMCAT -eq 1 ]
> then
> echo "- Startup Tomcat"
> sudo -b -u tomcat /opt/tomcat/bin/startup.sh
> # sudo -b -u tomcat /opt/tomcat/bin/startup.sh &
> # sudo -u tomcat /opt/tomcat/bin/startup.sh &
> fi
> echo "- Tailing CATALINA.OUT"
> tail -f /opt/tomcat/logs/catalina.out
> ------------------------------------------------------------
>
> A user would ssh in, run the script and at the end, watch the
> logs roll by. Normally they'd hit control+C, log out and
> everything would be fine. If they just close the window
> though, it not only ends their session and kills the shell
> but also kills tomcat. I've commented out the two other ways
> I've tried it, neither one helps. I'm running FC3.
> Anyone know what's going on?
>
> -Mike
>
>
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>
>
For any interested parties. I got a tip to try out nohup again. The
problem I was having earlier is that nohup tries to create a file called
"nohup.out". Since I was sudo-ing to "tomcat" this was a problem
because user tomcat did not have access to my user's home directories.
Here's the fix:
if [ $RESTART_TOMCAT -eq 1 ]then
cd /tmp
echo "- Startup Tomcat"
sudo -u tomcat nohup /opt/tomcat/bin/startup.sh
sudo -u tomcat rm nohup.out
Fi
echo "- Tailing CATALINA.OUT"
tail -f /opt/tomcat/logs/catalina.out
More information about the users
mailing list