Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:06:08+00:00 2026-06-12T12:06:08+00:00

I am able to run remote script in two ways. First (indirect) #ssh Second

  • 0

I am able to run remote script in two ways.
First (indirect)
#ssh
Second (after ssh connection)
#ssh
#
#exit (back to host terminal)

I believe that there is some difference in type of channel forwarding.
In other words when I used fist way fo running remote script, output of script should be printed not host mashine but remote one like that of the second way.

I have two machines uturksat1 and uturksat2
In uturksat2, I have a linux script (/tmp/runScript.sh) and Java class Provider. Linux script runs the Provider java application which is open a socket then listening it.

#!/bin/bash
echo "Provider"
$JAVA_HOME/bin/java -cp /tmp  Provider&
$JAVA_HOME/bin/java -version
rm  /tmp/pid
echo "$!"> /tmp/pid
echo "Provider-finish"
exit 0

On uturksat1 machine, I have type following command

root@UTURKSAT1:/tmp# ssh  uturksat2 /tmp/runScript.sh
Provider
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
Provider-finish
Waiting for connection

It does not return command prompt automatically, I have to press ctrl+c to return

When I have type the following command:

root@UTURKSAT1:/tmp# ssh -t  uturksat2 /tmp/runScript.sh
Provider
Waiting for connection
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
Provider-finish
Connection to uturksat2 closed.
root@UTURKSAT1:/tmp#

Provider app is not run, I can test it through telnet to port 2004 which Provider is listening.

telnet  uturksat2 2004

Finally last problem is that Provider uses log4j to keep its internall log, in the first way of remote linux script execution, log4j lof file is not created, but in the second way it is created.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:06:09+00:00Added an answer on June 12, 2026 at 12:06 pm

    I have openned same question with different explanation. It has been solved. Thanks your advices which keep my motivation high. Here is the solution as you have already known.
    Run remote java server in linux script

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to run a perl script which involves ssh to a remote server
I need to be able to run RegLoadKey() on a remote machine, and it
I would like to be able to run a nose test script which accepts
The idea is to run remote python or bash script by clicking run button
I haven't been able to reproduce this problem with another script, so please run
I have been able to run my C# .net 3.5 app just fine on
I am not able to run a simple select query with a where clause.
Suddenly I am not able to run my application on an emulator or device
I want to be able to run Junit tests from the command line, but
I need to be able to run an Oracle query which goes to insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.