Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-10

Can't run my programs in background

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Andersen

Hi there...

I have this problem with running my FreePascal programs in the background. When I start the program it runs just fine, but as soon as I press the enter button or logout, my program stops and I have to kill (9) to get rid of the stopped program... Anybody know about this?

I get following messages:

$ dialserver &		(default for running in background)
[1] 15825
$ 			(Here I press the enter button)

[1]+ Stopped (tty output) dialserver
$
$ killall -KILL dialserver
[1]+ Killed dialserver
$

/Miwer

Matthew Bradford
to Michael Andersen

I know including the CRT unit will do this, also, perhaps the use of writeln? But CRT is definate. Take that out and try it. If that does not work, then comment out your writeln's and readln's. If they are writing to an actual file or to stderr then it should work, otherwise that is probably the source of your problem.

Matt

Show quoted text 25 lines
Hi there... I have this problem with running my FreePascal programs in the background. When I start the program it runs just fine, but as soon as I press the enter button or logout, my program stops and I have to kill (9) to get rid of the stopped program... Anybody know about this? I get following messages: $ dialserver & (default for running in background) [1] 15825 $ (Here I press the enter button) [1]+ Stopped (tty output) dialserver $ $ killall -KILL dialserver [1]+ Killed dialserver $ /Miwer _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Pierre Muller
to Michael Andersen: Hi there... I have this problem with running my FreePascal programs in the background.…

At 16:41 09/10/00 , vous avez écrit:

Show quoted text 14 lines
Hi there... I have this problem with running my FreePascal programs in the background. When I start the program it runs just fine, but as soon as I press the enter button or logout, my program stops and I have to kill (9) to get rid of the stopped program... Anybody know about this? I get following messages: $ dialserver & (default for running in background) [1] 15825 $ (Here I press the enter button) [1]+ Stopped (tty output) dialserver

You are runnig a program in background, but this program wants to write to the terminal,
you must use 'fg' to enable it to continue.

But in genberal you should redirect the output and error files with

dialserver 1> log 2> error.log &

You might also need to redirect the input.

Ken J. Wright
to Pierre Muller
Show quoted text 22 lines
>I have this problem with running my FreePascal programs in the background. >When I start the program it runs just fine, but as soon as I press the >enter button or logout, my program stops and I have to kill (9) to get rid >of the stopped program... Anybody know about this? > >I get following messages: > >$ dialserver & (default for running in background) >[1] 15825 >$ (Here I press the enter button) > >[1]+ Stopped (tty output) dialserver You are runnig a program in background, but this program wants to write to the terminal, you must use 'fg' to enable it to continue. But in genberal you should redirect the output and error files with dialserver 1> log 2> error.log & You might also need to redirect the input.

If it is your intention to always run as a background process, then you might consider running as a daemon instead. Use daemon.pp from the contributed units page as an example.

Ken