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 8656919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:23:52+00:00 2026-06-12T15:23:52+00:00

I have a Server implemented in Java named Provider, and linux script to start

  • 0

I have a Server implemented in Java named Provider, and linux script to start 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

When I want to execute the following script at different machine (machine2)

root@machine1:/tmp# ssh  machine2/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

The problem is that after running above script, it does not return console, it hang-up though Provider gets started.

I have analized similar concepts like Glassfish domain starting. by executing

ssh machine2 asadmin start-domain

it returns console without any problem so I can get execution status “$?”

  • 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-12T15:23:53+00:00Added an answer on June 12, 2026 at 3:23 pm

    I think that the problem is that the remote sshd won’t close the ssh session because there is still a java process running in the background that might try to write output.

    Try redirecting the background processes stdout and stderr to “/dev/null”; e.g.

    $JAVA_HOME/bin/java -cp /tmp Provider > /dev/null 2>&1 &
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented simple proxy server using Java NIO channels, but have a problem,
I have to connect to a poorly implemented server that only understands Content-Type (capital-T)
I have implemented a web service with server and client authentication using keytool. The
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat
I have written several procedures and succesfully implemented them on my webhost's server. However
I have successfully implemented this from android to a java httpservlet on google app
I have several hand-written Java classes in a REST Server that uses JAXB to
I have a java app that creates a socket to talk to a server
I have a Java client that calls a RESTEasy (JAX-RS) Java server. It is
I have a client/server application that remotely connects to a server via Java's SSLSocket.

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.