You are not logged in.

#1 2008-03-09 18:14:01

Jen Smith
Member
Registered: 2008-02-18
Posts: 16

Autostart/autologin questions

Got some questions about starting a few programs up on boot.  (Not daemons)

I have a junker machine running Arch as a server (Abyss, Samba, MySQL and so on) and its running great.

I have a few console programs that I'd like to run when the system boots up, if it's possible.  These are Windows console apps, so they'll be running through Wine.  I've already tested them; they run flawlessly from a console.

What I'd like to do is to get them to start up when the system boots.  Normally that's not a big deal, but here's the tricky part.  I'd like each one to run on a separate virtual console.  There's three programs that need to run.  I'd like to have vc/2 through vc/4 log into a user account (not root), and launch each respective program when the system boots up.  I need to be able to look at each virtual console and monitor the program's output, and sometimes may need to interact with the program, so running it in the background isn't feasible.

Is that even possible? (If possible I'd like to not have to log into three consoles manually to start them up) And if so, how would I go about doing that?  I was thinking I could launch them via .bashrc, but I'm not sure if there's away to check to see what console it's logged in from and launch the appropriate application.

Appreciate any insights; thanks.

Offline

#2 2008-03-09 18:33:29

Jen Smith
Member
Registered: 2008-02-18
Posts: 16

Re: Autostart/autologin questions

Edit - found a partial answer to my own question.   (RTFM..er Wiki) Got the login bit worked out.

To rephrase my question then -- is it possible for .bashrc to figure out which virtual console I'm logged in under, and to launch a different program depending on the result?  That one I couldn't find information on in the Wiki or Google. I didn't see anything via uname or exported environment variables anyway.

Thanks again.

Offline

#3 2008-03-09 18:43:30

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: Autostart/autologin questions

If you already found a way to autologin, you can use something like this on .bashrc:

if [ $(tty) = /dev/vc/1 ]; then
    # run some stuff on vc1
fi

if [ $(tty) = /dev/vc/2 ]; then
    # run some stuff on vc2
fi

...

Offline

#4 2008-03-09 18:53:21

Jen Smith
Member
Registered: 2008-02-18
Posts: 16

Re: Autostart/autologin questions

Remind me to send you a Christmas card later this year. Thanks, that was dead on.

Offline

Board footer

Powered by FluxBB