![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| TomCat access in an Remote Linux Server | gothama | UNIX for Dummies Questions & Answers | 1 | 03-13-2008 09:17 AM |
| shutting down/restarting oracle with the solaris server restart | krishan | SUN Solaris | 3 | 07-08-2005 10:25 AM |
| jsp not working on linux running tomcat server | mile1982 | Linux | 1 | 10-14-2004 06:18 AM |
| Run tomcat at startup | Spetnik | UNIX for Dummies Questions & Answers | 4 | 07-03-2003 11:29 PM |
| how can I restart X server ? | oneivan | UNIX for Dummies Questions & Answers | 6 | 10-16-2002 09:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to restart the tomcat server
hi,
I need a command that restart the tomcat server. for example for restart the tomcat i am using following command, /etc/init.d/tomcat restart ..but sometimes is not working...might be i want to use java code access this peace of script. like using the grep and ps commands can i use? 1.find the tomcat is running or not if yes find the command and try to execute that command again for example ps -ef| grep tomcat >>/dev/null i am not sure how to write such scenario... please help anybody on this? Thank you Sankar |
|
||||
|
This can be used..
Code:
#!/bin/bash export OPTS=$* if [ ! -z "$OPTS" ]; then grep -v "EXTRA_JAVA_OPTS" /etc/tomcat5/tomcat5.conf > /tmp/tomcat5.conf cp /tmp/tomcat5.conf /etc/tomcat5/tomcat5.conf echo EXTRA_JAVA_OPTS=\"$OPTS\" >> /etc/tomcat5/tomcat5.conf echo "JAVA_OPTS=\"\$EXTRA_JAVA_OPTS \$JAVA_OPTS\";export JAVA_OPTS" >> /etc/tomcat5/tomcat5.conf fi /sbin/service tomcat5 restart |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|