Sponsored Content
Top Forums Shell Programming and Scripting Running backend processes in ssh Post 302862651 by chandana hs on Friday 11th of October 2013 07:45:48 AM
Old 10-11-2013
Running backend processes in ssh

Hi Team,
i have a script alloc.sh on server1
Code:
main () {
if [ "$1" == "REQUEST" ] ; then
    (nohup ./alloc.sh ALLOCATE 5400 isogen_alloc_$2 < /dev/null 2> /dev/null &)
    echo ALLOC_OK
    exit 0
fi
if [ "$1" == "ALLOCATE" ] ; then
    sleep $2
fi
}
main $@

Here if i execute the alloc.sh on server1, it gets executed successfully.
purpose of this script is to run a process in background for 5400 seconds for monitoring reservation of server1 for some purpose.

But the problem here is, if i execute the same script from server2(where passwordless to server1 is enabled),

Code:
On Server2:
ssh root@server1 './alloc.sh REQUEST ABC_123456'
ALLOC_OK
<it'll come out after the sleep time>

the script is not going for background.!

Could you pls check why the command (nohup ./alloc.sh ALLOCATE 5400 isogen_alloc_$2 < /dev/null 2> /dev/null &) is not working as expected when i call this from server2.

Regards,
Chandana
 

10 More Discussions You Might Find Interesting

1. Programming

getting certain info for all processes currently running

i am writing a utility that displays information about all the running processes in the /proc directory. I do not know how to get the following information for each of the processes in the /proc directory: -effective user id -effective user name -effective group id -effective group name... (3 Replies)
Discussion started by: Yifan_Guo
3 Replies

2. UNIX for Advanced & Expert Users

running processes with no hang up

Can we run a script in nohup which calls another script in nohup. eg Script1.sh #Script1 start nohup script2.sh . . . #end script1.sh Now can I do this nohup script1.sh Also is all scheduled processes (crontab entries) will run as nohup? Would appreciate if any one can... (3 Replies)
Discussion started by: yakyaj
3 Replies

3. Shell Programming and Scripting

monitoring running processes

I have a script that runs continuously and will deliver a file to multiple servers via scp. On occasions one of the scp's will hang and as a result not complete in sending the remaining files and not loop around again. If I run the scp commands with a & they'll complete, but I want to make sure... (2 Replies)
Discussion started by: nhatch
2 Replies

4. Shell Programming and Scripting

how to know the running processes.

Hi can anybody help me regarding this.. i want know the output of ps -ef with explanation. how can we know the running processess. this is the output of ps -elf F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 19 T root 0 0 0 0 SY ... (1 Reply)
Discussion started by: rajesh_pola
1 Replies

5. UNIX and Linux Applications

phonon-backend-gstreamer vs phonon-backend-vlc vs phonon-backend-xine

phonon-backend-gstreamer vs phonon-backend-vlc vs phonon-backend-xine What are the advantages and disadvantages of phonon-backend-gstreamer, phonon-backend-vlc, and phonon-backend-xine. I was reading this and got curious. ... (1 Reply)
Discussion started by: cokedude
1 Replies

6. Solaris

Running processes on GZ/LZ

Hi guys just a question is it normal to see running process on a non-global zone in the global zone... processes such as cron. (3 Replies)
Discussion started by: batas
3 Replies

7. Linux

Running processes

Hi guys is it normal to have 5-10 cron/syslog processes running... in my case i got 10 cron process running. (4 Replies)
Discussion started by: batas
4 Replies

8. Solaris

Sendmail processes not running

Hi All! I am trying to get sendmail to work but unsuccessfull...when I run ps -ef | grep sendmail root 10578 10561 0 11:01:24 pts/1 0:00 grep sendmail I do not see its processes When I run the following commands: bash-3.00# svcs sendmail svcs: Pattern 'sendmail' doesn't match... (9 Replies)
Discussion started by: fretagi
9 Replies

9. Shell Programming and Scripting

Check Running Processes

I want to check how many processes are running with same names and get their respective counts. ps -ef|grep -Eo 'process1|process2|process3| '|sort -u | awk '{print $2": "$1}' Output would look like : $ ps -ef|grep -Eo 'process1|process2|process3| '|sort | uniq -c | awk '{print $2":... (8 Replies)
Discussion started by: simpltyansh
8 Replies

10. UNIX for Beginners Questions & Answers

Many processes running at the same time

Hello everybody , I launched cron to execute a task every hour but the job takes more than hour that's why I'm getting more than 1000 cron processes running at the same time !!! My question is how to tell cron not to execute unless the job terminated in order to have only one process running .... (14 Replies)
Discussion started by: beautymind
14 Replies
asadmin-stop-instance(1AS)					   User Commands					asadmin-stop-instance(1AS)

NAME
asadmin-stop-instance, stop-instance - stops the specified server instance and all the services associated with it SYNOPSIS
stop-instance [--user admin_user] [--password admin_password] [--host local_host] [--port 4848] [--local=false] [--domain domain_name] [--secure|-s]instance_name Use the stop-instance to stop the instance with the instance name specified. The stop-instance can be run both locally and remotely. The named instance must already exist within the given domain; and the instance must be running. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --local determines if the command should delegate the request to administrative instance or run locally. --domain name of the domain. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. OPERANDS
instance_name name of the instance to be stopped. Example 1: Using stop-instance in local mode asadmin> stop-instance --local --domain domain1 server1 Instance server1 stopped Where: the server1 instance associated with the domain1 domain is stopped locally. Example 2: Using stop-instance in remote mode asadmin> stop-instance --user admin --password bluestar --host localhost --port 4848 server1 Instance server1 stopped Where: the server1 instance associated with the named user, password, host and port is deleted from the remote machine. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Server Instance page asadmin-delete-instance(1AS), asadmin-start-instance(1AS), asadmin-create-instance(1AS), asadmin-restart-instance(1AS), asadmin-start- appserv(1AS), asadmin-stop-appserv(1AS), asadmin-start-domain(1AS), asadmin-stop-domain(1AS) J2EE 1.4 SDK March 2004 asadmin-stop-instance(1AS)
All times are GMT -4. The time now is 04:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy