Re: open controlling terminal from cron
From: Charles Carrano (c.carrano_at_att.net)
Date: 09/08/03
- Previous message: Chuck Dillon: "Re: open controlling terminal from cron"
- In reply to: Chuck Dillon: "Re: open controlling terminal from cron"
- Next in thread: Louis Erickson: "Re: open controlling terminal from cron"
- Reply: Louis Erickson: "Re: open controlling terminal from cron"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Sep 2003 14:39:58 -0700
Chuck Dillon <cdillon@nimblegen.com> wrote in message news:<3F5C8BF9.7040500@nimblegen.com>...
> Charles Carrano wrote:
> > Is it possible to open a controlling terminal
> > (for output only) via cron? I'd like to dedicate
> > /dev/tty1, for example, on my linux (RH 9.0) box
> > to the ncurses display of a program written in C
> > that requires no user input. Is this possible?
> >
> > For the curious, my intention is to use the linux
> > box as a real-time measurement/display system, where
> > the console is dedicated to showing GPS measurements
> > acquired from a receiver through the serial port.
> >
> > Thanks!
>
> If you look at /etc/inittab you will probably see that it has entries
> that cause getty/mingetty to run on the tty devices. These are just
> little programs that wait for evidence that someone is trying to use
> the tty and then exec login. When the user session ends the system
> sees that the device is uncovered and spawns another getty/mingetty to
> wait for another user to come along.
>
> You can replace one of those entries with a call to your program (or a
> wrapper that calls it). When you do you remove the getty/mingetty that
> is getting in your way now and you get the system to make sure your
> program is always running on that device.
>
> Man init.d, inittab and mingetty
>
> -- ced
Thank you very much. This is exactly what I wanted -- a way to start
my ncurses-based program at boot, and restart it automatically if the
program should crash. No cron needed!
I have noticed that running via inittab in this way causes me to lose
some special characters (the ones that ncurses uses to draw boxes),
versus running from the command line prompt. This is likely some
kind of terminal misconfiguration, however, and is likely something
I can figure out.
Thanks again. You've taught me a lot about how UNIX/Linux works :-)
Regards,
Charles Carrano
- Previous message: Chuck Dillon: "Re: open controlling terminal from cron"
- In reply to: Chuck Dillon: "Re: open controlling terminal from cron"
- Next in thread: Louis Erickson: "Re: open controlling terminal from cron"
- Reply: Louis Erickson: "Re: open controlling terminal from cron"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]