LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2010, 01:08 PM   #1
c0m4r
LQ Newbie
 
Registered: May 2009
Posts: 9

Rep: Reputation: 0
sending remote command to background process + out log


Hi,

Because of my English skills I'll try to explain this subject as best I can, thank you for understanding. Fisrt of all, I am running some program on my slackware in background (using standard method - &). I need to make a script, which allows sending command to this process on my machine from another one. Furthermore this program have to be logged out (standard output f.e. ./myprogram > log.out.txt).

It might be a separate Program A which runs my Program B but it cannot be screen, because it is not working like I'd like to and it cannot be java, because it's slow and working not the best so to speak.

Thank you for your support.

Best regards,
Andrew

Last edited by c0m4r; 02-01-2010 at 01:10 PM.
 
Old 02-01-2010, 01:33 PM   #2
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
why not add networking or unix-sockets(or a shared file at least) in order to communicate with a process?
or use signaling system.
which language is your program written with?
 
Old 02-01-2010, 01:53 PM   #3
c0m4r
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
why not add networking or unix-sockets(or a shared file at least) in order to communicate with a process?
Unfortunately I do not quite understand. Can you refer to any article about it? Program is started by common bash script. I have no idea about used programming language.
 
Old 02-01-2010, 05:31 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Do you mean the program is started in a bash script, or is it written in bash? If it's not written in bash, what programming language is it written in?
 
Old 02-02-2010, 02:43 AM   #5
c0m4r
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
It's acutally game server. I am starting it like this:

./myscript which is starting -> ./hlds_run - which is a bash script, and this script is starting another process, depending on which cpu you have, f.e. hlds_i686 for intel.

Quote:
hlds_i686: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
That's the everything I got from compiled bin.
 
Old 02-02-2010, 04:23 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
To be honest I'd go with screen which realy is the easiest solution. Maybe we can help you sort out the problems you had?

Nother thing would be to use the fg shell command. Start the half live server in background
Code:
hlds_start > /tmp/log_hdls &
Then from the other programm run
Code:
fg
command you want to send
I guess this will not work as expected cause the fg takes another input than the programm running but who knows.

Else you would have to work with some kind of tty reader and writer.
Maybe this link helps out. I just touched it but might be the chance to write some C prog to achieve what you need.
http://www.win.tue.nl/~aeb/linux/lk/lk-11.html
 
Old 02-02-2010, 04:34 AM   #7
c0m4r
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
I guess this will not work as expected cause the fg takes another input than the programm running but who knows.
It is not that simple as it might be.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending signal SIGQUIT to a process forked by remote machine v_sharma Linux - Server 0 03-15-2009 03:57 AM
sending appche log to a remote syslog server sezam2 Linux - Server 4 02-18-2009 07:09 PM
Urgent : Regarding sending a current running process in background Ricky Linux - General 5 11-27-2007 02:07 PM
How can i get this command to restart at boot and in the background even if i log off abefroman Linux - Security 1 09-07-2004 03:40 PM
sending process to background Robert0380 Linux - General 5 12-31-2002 03:33 PM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration