[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Autostart application from console



John Plate:
> > How can I have a console start up an application automatically when
> > the system boots?

Jens Ritter:
> Look at the "open" package and the scripts in /etc/init.d and have a
> look at /etc/inittab, too.

The difference between the two being that the init.d scripts are run once,
whereas the /etc/inittab entries can be set to keep the program running on
the tty.

For /etc/inittab, I use the -n and -l switches to getty, like this:
    #put a top on VT 11
    #note: this runs as root, with kill priviledges and everything
    11:23:respawn:nice /sbin/getty -n -l /usr/bin/top 38400 tty11

    #show /var/log/syslog on VT 12
    #note: /etc/cron.daily/syslogd kills whatever's using /dev/tty12
    12:23:respawn:/sbin/getty -n -l /usr/local/bin/showlog 38400 tty12

I consider my console to be secure; if you don't, you probably want to give
top the secure switch (top s) - you'll need to put that in a shell script,
though, because getty doesn't let you pass parameters. The showlog script
is: date +"$0 started %c"; /usr/bin/tail -f /var/log/syslog


Jiri
-- 
<jiri@baum.com.au>
We'll know the future has arrived when every mailer transparently
quotes lines that begin with "From ", but no-one remembers why.


Reply to: