I have a process that i run with this command:

java -jar loginserver.jar &

I need to be able to send commands to this program. I've tried bg/fg but apparently it doesn't persist thru sessions. Is there any other way I can do this?

closed as not a real question by EEAA, Michael Hampton, Magellan, rnxrx, Ward Oct 16 '12 at 17:35

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What type of input do you need to send? – EEAA Oct 11 '12 at 4:05
  • Just text. Commands like 'shutdown 10' where 10 is the number of minutes before it shuts down.. etc. I've also tried echo "shutdown 10" > /procs/pid/fd/0 with no success. The bg/fg works but only in the same ssh session. – Tar Oct 11 '12 at 4:05
  • Are the only commands that you're trying to send shutdown or restart commands? Are you trying to run this as a daemon rather than just a process within your shell session? – Dave Forgac Oct 11 '12 at 5:31
  • This is a loginserver. I can send commands to shutdown worlds for a game I'm hosting. The commands are interpreted by the loginserver, so they can really be whatever. Shutdown was just an example. – Tar Oct 11 '12 at 5:55

Try screen (http://linux.die.net/man/1/screen).

Not the answer you're looking for? Browse other questions tagged or ask your own question.