Solved

shell script

Posted on 2013-11-21
4
477 Views
Last Modified: 2013-12-11
I start a application from the cmd line by running cmd below:
~]# /bin/su - xsis -c "/tool/apps/DMC/xsistest/xsis/scripts/start-sis -u xsis -p ALL"

the script=start-sis
xsis= app account
path to the script to start the app =  "/tool/apps/DMC/xsistest/xsis/scripts/start-sis -u xsis -p ALL"
I am looking for a wrapper script to run cmd above to start the app. The app is on a 2 node active/passive cluster. I want to have the cluster service run the wrapper script to execute the cmd when the cluster failover.

Thnx!
0
Comment
Question by:binadmin
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:simon3270
ID: 39668486
Just write this in a file:
#!/bin/bash

/bin/su - xsis -c "/tool/apps/DMC/xsistest/xsis/scripts/start-sis -u xsis -p ALL"

Open in new window

This assumes that the script needs to run as a foreground task (which is common with High Availability systems, so that the HA system can monitor a specific process ID easily)
0
 

Author Comment

by:binadmin
ID: 39669296
after it execute the third line can it hand off/stop running...Im concern this file or script might execute the cmd and stay around and eventually become a rogue process...Anyway to make it exit after it execute.

Any thoughts?
0
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 39677278
I'm not sure what you want this to do (compared with your other wrapper script), and what start-sis actually does.

If start-sis starts the SIS program in the background, then it will complete execution and the script will finish, with no "rogue" processes running.

if start-sis runs the SIS program in the foreground, and doesn't finish until the SIS program itself has finished, then you'll have a couple of spare processes - the script itself, and the "su" command.  these should continue as long as start-sis runs.  you can reduce this number by one by adding "exec " to the start of the "su" line - in that case, the script itself is replaced by the "su" command.
0
 

Author Closing Comment

by:binadmin
ID: 39711514
We used the init script provided by the vender..Thnx alot for ur help.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question