Solved

shell script

Posted on 2013-11-21
4
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

739 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