Cant run program in background

Cant run program in background

Post by Fabio Giannott » Wed, 04 Oct 2000 04:00:00



On 5.0.5, I have a ELF 32-bit LSB executable (tin) that seems to not want to
work unless it is on an active tty.

If I try to run the program in the background (using &), I get:

  select() failed: Error: Invalid arguement

Is there a way to "fool" it into thinking it is on an active tty?
(Ultimately, I want to run this in cron.)

Thanks in advance,
Fabio

 
 
 

Cant run program in background

Post by Tom Parson » Wed, 04 Oct 2000 04:00:00


Fabio Giannotti enscribed:
| On 5.0.5, I have a ELF 32-bit LSB executable (tin) that seems to not want to
| work unless it is on an active tty.
|
| If I try to run the program in the background (using &), I get:
|
|   select() failed: Error: Invalid arguement
|
| Is there a way to "fool" it into thinking it is on an active tty?
| (Ultimately, I want to run this in cron.)

Try setting TERM={just_about_any_terminal_type}  in your cron script.
--
==========================================================================

==========================================================================    

 
 
 

Cant run program in background

Post by Brian K. Whit » Wed, 04 Oct 2000 04:00:00



> On 5.0.5, I have a ELF 32-bit LSB executable (tin) that seems to not want to
> work unless it is on an active tty.

> If I try to run the program in the background (using &), I get:

>   select() failed: Error: Invalid arguement

> Is there a way to "fool" it into thinking it is on an active tty?
> (Ultimately, I want to run this in cron.)

> Thanks in advance,
> Fabio

*maybe* with expect (see skunkware)
maybe with nohup (standard command)

and/or maybe by simply redirecting one or more of fd's 0, 1, and 2.
explanation: maybe when a program goes into the background it just closes  0
(stdin), 1(stdout), and 2 (errout) and so you can't call select() on
nothing. so maybe if you supply someting for select() to act on that will be
good enough. so perhaps just tuoch a couple files progin, progout and run
with  prog 0<progin >progout 2>&1

or perhaps use an existing but always unused tty
disable tty06
prog </dev/tty06 >/dev/tty06 2>/dev/tty06
(I just tried this with a simple "more" command and it didn't quite work as
I'd hoped. it displayed the output on tty06, but didn't accept any
keystrokes from tty06 or anywhere else, had to kill -HUP the process. but
something like this might still get you program to run if you don't need to
send it any keystrokes anyways. or you could store the input in a regular
file and do  prog <file >/dev/tty06 2>&1

I think linux has a command for running a program on a particular tty
instead of the current one, something like "vcopen" , anyone know of a sco
equivalent?

--
Brian K. White                   http://www.squonk.net/users/linut
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani

 
 
 

Cant run program in background

Post by Fabio Giannott » Thu, 05 Oct 2000 04:00:00


Tom,

Thanks for the suggestion, but I had already tried that.  (as well as
setting PATH, LOGNAME, HOME, TZ and every other env variable.)

Fabio


> Fabio Giannotti enscribed:
> | On 5.0.5, I have a ELF 32-bit LSB executable (tin) that seems to not
want to
> | work unless it is on an active tty.
> |
> | If I try to run the program in the background (using &), I get:
> |
> |   select() failed: Error: Invalid arguement
> |
> | Is there a way to "fool" it into thinking it is on an active tty?
> | (Ultimately, I want to run this in cron.)

> Try setting TERM={just_about_any_terminal_type}  in your cron script.
> --
> ==========================================================================

> ==========================================================================

 
 
 

Cant run program in background

Post by Fabio Giannott » Thu, 05 Oct 2000 04:00:00


Thank you Brian!

I had tried to redirect stdout and errout, but never even thought of
redirecting stdin!

Redirecting input from an empty file worked just great.

Thanks again,
Fabio




> > On 5.0.5, I have a ELF 32-bit LSB executable (tin) that seems to not
want to
> > work unless it is on an active tty.

> > If I try to run the program in the background (using &), I get:

> >   select() failed: Error: Invalid arguement

> > Is there a way to "fool" it into thinking it is on an active tty?
> > (Ultimately, I want to run this in cron.)

> > Thanks in advance,
> > Fabio

> *maybe* with expect (see skunkware)
> maybe with nohup (standard command)

> and/or maybe by simply redirecting one or more of fd's 0, 1, and 2.
> explanation: maybe when a program goes into the background it just closes
0
> (stdin), 1(stdout), and 2 (errout) and so you can't call select() on
> nothing. so maybe if you supply someting for select() to act on that will
be
> good enough. so perhaps just tuoch a couple files progin, progout and run
> with  prog 0<progin >progout 2>&1

> or perhaps use an existing but always unused tty
> disable tty06
> prog </dev/tty06 >/dev/tty06 2>/dev/tty06
> (I just tried this with a simple "more" command and it didn't quite work
as
> I'd hoped. it displayed the output on tty06, but didn't accept any
> keystrokes from tty06 or anywhere else, had to kill -HUP the process. but
> something like this might still get you program to run if you don't need
to
> send it any keystrokes anyways. or you could store the input in a regular
> file and do  prog <file >/dev/tty06 2>&1

> I think linux has a command for running a program on a particular tty
> instead of the current one, something like "vcopen" , anyone know of a sco
> equivalent?

> --
> Brian K. White                   http://www.squonk.net/users/linut
> +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
> filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani

 
 
 

Cant run program in background

Post by John DuBo » Thu, 12 Oct 2000 14:17:48




Quote:>I think linux has a command for running a program on a particular tty
>instead of the current one, something like "vcopen" , anyone know of a sco
>equivalent?

Depending on exactly what vcopen does, "recon" may have equivalent
functionality.  New in 5.0.6.

        John
--

 
 
 

1. put a running program in background in the program itself

Is there any way to place a running program in the background, in the code itself?

I tried putting "bg" in the code.. but no luck...

Any shell is okay, but I prefer csh.

--
Sheep follow shepherds, even to the butcher's shop.
                                                      _


2. execvp failure

3. running a program in background after logoff, no screen

4. unsubscribe

5. Cant run programs from shell

6. PPP, Help, Help, Help~~~~~~~

7. programs running in background

8. Where can I find a PD KSH?

9. How do I run a program in the background and redirect the error messages?

10. programs running in background

11. self-compiled programs won't run -- unix cant find them!

12. Running a perl script as a background program.

13. How to findout program running in background?