RE: Script Question (solved)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

> -----Original Message-----
> From: fedora-list-bounces@xxxxxxxxxx 
> [mailto:fedora-list-bounces@xxxxxxxxxx] 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@xxxxxxxxxx
> 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



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux