2

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?

Tar
  • 265
  • 4
  • 11
  • What type of input do you need to send? – EEAA Oct 11 '12 at 04: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 04: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 05: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 05:55

1 Answers1

-1

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

Laurentiu Roescu
  • 2,266
  • 17
  • 17