?
Solved

shell script

Posted on 2013-11-21
4
Medium Priority
?
487 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 1500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 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