Scripting
New member needing some help with a script. With in my script I am needing a command that will automatcilly stop a process on a differnet platform, stop or put it to sleep just right beform my program begins to run. I believe it might be a simple command, involving the ssh command with aplicable permission (authentication) between the two different plaforms to access/scriptively to login into this terminal to stop this process from running. I am not a script writting person, but can read and diagnose a script, but write one -this is where my weakness appears. Please helf, a suggestion is needed quickly. Thank you, Pantene.
|
So I understand your question:
You have a script (bash? perl? php? something else?) that, when run, needs to disable a process on a remote system. Is this correct? If you want to do this via ssh you'll want to look at passwordless logins (there are many, many threads on this here at LQ), as well as `man kill` to read about stopping other processes. |
This will be a bash script, and during the time of script execution, this line will send a signal to the remote system to either stop, or put the remote system process to sleep. I would also thing the ssh process will be involve. Now the passwordless login will be ideal. Can you help me with devising such a command within my script to execute this operation. Please advise.
Thanks, Pantene |
You're not really being clear. Perhaps if you gave us the email address of your professor, we could ask him our questions directly.
Forrest |
OK, once more. Within my script need a command that will send a signal to a remote linux terminal to stop a process from running during the period in which my script is running on my platform. I am sorry, but can not make it any clearer.
Again, thanks, Pantene |
OK, if you can give me the answers to the following questions, I will help you put the pieces together:
Note: I don't need the parameters to the commands, just the commands. I don't want specifics related to you, just generally. 1) How do you log into a remote machine with ssh? 2) What commands do you need to run to set up passwordless ssh connections between hosts? 3) What command do you use to stop a process? 4) What command do you use to determine the process id that you want to stop? 5) Give me as least an attempt to put the above 4 together in a script. I'll even go a little further. If you can come up with ANY answer to the above that is close, I'll consider it correct. I'll help you with your homework, but I'm not doing it all for you (You'll appreciate it in the future). Forrest |
Quote:
Set up a user account for this job on the remote box and set up SSH key auth for the user. As far as stopping the process, figure out what the command is to stop the process. then in your script: Code:
/path/to/ssh user@host '[command]' You can get your full path to ssh using Code:
$ which ssh You need to install your private key in the user who will be executing the script so that when it runs, the key is available in the executing user's context. If your account will be running it install it in yours. -Viz |
All times are GMT -5. The time now is 10:20 AM. |