2014-09-28 10:08 GMT-06:00  <meino.cra...@gmx.de>:
>
> Randolph Maaßen <r.maasse...@gmail.com> [14-09-28 16:24]:
>> On Sep 28, 2014 4:14 PM, <meino.cra...@gmx.de> wrote:
>> >
>> > Hi,
>> >
>> > I want to run programs, which insist on haveing a terminal
>> > to write their status to and which are writing files which
>> > their results on a headless computer (beaglebone).
>> >
>> > I tried things like
>> >
>> >     my_program -o file.txt -parameter value > /dev/null &2>&1 &
>> >
>> > but this results in a idle copy of this process and a defunct
>> > child.
>> >
>> > The program does not use X11 in any way...
>> >
>> > Is there any neat trick to accomplish what I am trying to do here?
>> >
>> > Thank you very much in advance for any help!
>> > Best regards,
>> > mcc
>> >
>> >
>> >
>>
>> I would suggest to run the program in a screen session, you can disconnect
>> frim the session and reconnect later.
>>
>> http://www.gnu.org/software/screen/
>>
>> --
>> Best regards
>> Randolph Maaßen
>
> Hi Randolph,
>
> ...the headless device will be booted and the programm will be startet
> via a kind of autostart script. No human intervention is
> wanted/possible...
>

You can use ">&-" in the script to run the program with stdout closed
by default, but this might result in an error if the program relies on
stdout open example:
---
$ echo "Hello" >&-
bash: echo: write error: Bad file descriptor
---
but if I do this(stdout and stderr closed):
--
$ echo "Hello" 2>&- >&-
--
nothing is printed
but
--
$ echo $?
1
--
However if I try to run an application that uses X it starts normally.
more info on this stuff on [1]
in page 15 it's kind of explained the case of programs running with ">&-"
https://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodbye-world.pdf

> Best regards,
> mcc
>
>
>

Reply via email to