LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2006, 09:46 PM   #1
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
Smile Headless, mouseless, keyboardloess SuSE box


Hi all,

I've installed SuSE 9.3 on HP Compaq (Athlon 64 3500+). I want to make this box headless, mouseless and keyboardless. Once it's boot up properly, it's able to pop-up a window (xterm, etc) on another workstation (running Solaris/Windows OS) to indicate that the SuSE box is boot-up properly and in good health. And if turn off, it will close the pop-up window on the remote workstation.


Any guys here know any tools/scripts which is able to do this. Many thanks.

regards,

lennon
 
Old 06-29-2006, 11:02 PM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
The first thing you want to do is use init level 3 as your default. You don't want to run an Xserver.

Edit /etc/inittab and change
Code:
id:5:initdefault:
to
Code:
id:3:initdefault:
Now create a user (anyone is good... but it's easiest if you use the same username on the machine you want the window to appear on). Create the following file in their directory.

As that user run "ssh-keygen -t dsa" and use an empty passphrase. Then
Code:
cat ~/.ssh/id_dsa.pub | ssh username@hostname.of.display.machine "cat >> ~/.ssh/authorized_keys"
This will mean your headless machine user can log in without a password prompt. It's somewhat important to making this automatic. Consider the security implications of this because if someone gets into that account they can get into your machine.

As the user on the headless machine, create /home/{username}/window.sh and make it executable. Use the following, changed to suit your environment.
Code:
#!/bin/sh
# Use the hostname given in "xauth list" on the
# display machine.  Not localhost but something which can be
# reached from this machine.
remote=hostname.of.display      
SSHCMD="ssh username@$remote"

DISPLAY=${remote}:0 ; export DISPLAY
xauth add ${remote}:0 `${SSHCMD} xauth list | grep $remote | grep XDM | awk '{print $2 " " $3}'`
xterm &
Then you just set this program to run at boot (as your user). And you're set.

The window will close automatically when the machine goes through shutdown.

Last edited by frob23; 06-29-2006 at 11:04 PM.
 
Old 06-30-2006, 12:51 AM   #3
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Thumbs up

Hi Frob23,

Thank you for your clear instructions. I'm able to run the window.sh script now on init 5.

The problem is where to place this program to run at boot? I looked through and found it can be place in ~/.xinitrc file under my user directory:
Code:
/export/home/users/lennon/window.sh
exec startkde
As I'm still doing testing, I'm plugin my monitor, keyboard and mouse to this SuSE box, when boot up, nothing shown on remote workstation. But if login my user on this SuSE box than the xterm will pop up on the remote workstation. Anyway to pop up on remote workstation but without login in on my SuSE box?

The pop up window is not close when SuSE box is shutdown, it'll only close when the SuSE box is restarted.
 
Old 06-30-2006, 06:09 PM   #4
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
Okay, don't put it in .xinitrc. And don't start KDE. You're not running a window manager on this machine, are you? You just want a terminal into it.

I realize that I didn't tell you how to set it up at boot and to properly shutdown.

Save the following as /etc/rc.d/statwindow
Code:
#!/bin/sh
#This is a script to control the remote terminal window
#program.

case $1 in
    start)
        su lennon -c /export/home/users/lennon/window.sh
        ;;
    stop)
        for pid in `ps aux | grep xterm | awk '{print $2}'`
        do
            kill $pid
        done
        ;;
    *)
        echo "Unknown command."
        ;;
esac
The do the following:
Code:
cd /etc/rc.d/rc3.d
chmod +x ../statwindow
ln ../statwindow S99statwindow
ln ../statwindow K22statwindow
This should take care of it for you. Note, linux distros are often slightly different in how they boot... but this should work. I also admit that I hesitated to offer advice on that specific part because I don't use linux daily and don't even have a spare system to test it on here. The BSDs use a different system.

Edit: If this doesn't work... find where Suse store the boot scripts for each init level and add the links for this one in a similar manner to how it's done above.

Last edited by frob23; 06-30-2006 at 06:11 PM.
 
Old 07-02-2006, 11:24 PM   #5
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Wink

Quote:
Originally Posted by frob23
Okay, don't put it in .xinitrc. And don't start KDE. You're not running a window manager on this machine, are you? You just want a terminal into it.

I realize that I didn't tell you how to set it up at boot and to properly shutdown.

Save the following as /etc/rc.d/statwindow
Code:
#!/bin/sh
#This is a script to control the remote terminal window
#program.

case $1 in
    start)
        su lennon -c /export/home/users/lennon/window.sh
        ;;
    stop)
        for pid in `ps aux | grep xterm | awk '{print $2}'`
        do
            kill $pid
        done
        ;;
    *)
        echo "Unknown command."
        ;;
esac
The do the following:
Code:
cd /etc/rc.d/rc3.d
chmod +x ../statwindow
ln ../statwindow S99statwindow
ln ../statwindow K22statwindow
This should take care of it for you. Note, linux distros are often slightly different in how they boot... but this should work. I also admit that I hesitated to offer advice on that specific part because I don't use linux daily and don't even have a spare system to test it on here. The BSDs use a different system.

Edit: If this doesn't work... find where Suse store the boot scripts for each init level and add the links for this one in a similar manner to how it's done above.

Hi Frob23,

Thanks for your assitance. I put the statwindow script in rc.d and make it run at level 3 however the xterm is still unable to pop-up on remote workstation after boot-up. I try to look around and see what I can do, many thanks Frob23.
 
Old 07-03-2006, 02:33 AM   #6
kehtahui
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hi all,

I'm using crontab to execute xterm and display on remote workstation, i also check the process id of xterm to ensure that it will only pop-up only single xterm on remote workstation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A Mouseless Quest... DreameR-X Linux - General 6 03-24-2008 07:49 AM
minimal headless file sharing box gideont Linux - Networking 12 09-11-2005 11:35 PM
Cannot see my Win XP SP2 box with shared printer from my SUSE Pro 9.3 box thorlin Linux - Networking 3 09-11-2005 01:16 PM
How do I get my Suse 9.1 box to print to the printer attached to my Win XP box? PadreFabuloso Linux - Newbie 2 06-23-2005 04:06 PM
headless, keyless box control via eth0 class_struggle Linux - General 2 09-04-2004 10:58 AM


All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration