This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Top initscript

 
John Ahmadi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Howcan I write an script which has start/stop/status option including a program for example " Top" where I start as background process.

I tried this
==============================

#!/bin/bash
top
==========================
It's work but when I entered:

#!/bin/bash
top &

=======================
I got this error:

./test: line 3: top & : command not found
===================================

Overall my main question is how can I write script . I've an script for weblogic as " startWebLogic.sh" and I copied the script to /etc/init.d
and /etc/rc3.d and made an symbolic link like:


code:ln-s /opt/bea/domains/admin/startWebLogic.sh /etc/rc3.d/S90startWeblogic


but the problem is that I don't know how can I stop the program or restart it again.command kill it's not suitable to do that.
any help?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on how to stop the things, your script is starting.

Perhaps you find a script /etc/init.d/skeleton, which is a skeleton for building start-stop-restart-... - Scripts.

But I guess you're not the first one, who needs a start-stop-script for Weblogic, so there should be a usable script to be found in the net.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic