Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-31-2007, 07:22 PM   #1
Registered: Jan 2007
Distribution: Debian Etch
Posts: 193

Rep: Reputation: 30
Some things I'd like my server to do - And can't figure out

What I want to do is, starting with the most simple:

1. Make it automatically run 'vncserver' in a terminal so I don't have to do that blindly (or switching monitor over) to start it.
2. Make it automatically log on when starting up.
3. Scheduled (automatic) restarts at the time most suitable, i.e, when no one accesses the website.
9293282. Make it turn itself back on if it shuts down (yea right...)

Other things is, I'm running a site with apache2, php5, mysql5, and anything that requires email validation says it sent, but no one ever recieves the e-mail - how do I set this up to work properly? I'd rather not let people sign up with bogus e-mail addresses.

Also, last night I woke up to find my server off Is there ANY log that could tell me why, what happened, or when it turned off?

I don't have the experience to use Debian or anything else than FC6 really.
Old 05-31-2007, 10:44 PM   #2
LQ Newbie
Registered: May 2003
Distribution: Ubuntu
Posts: 22

Rep: Reputation: 15
1. When do you want vncserver to run? At startup? If so just add it to your startup scripts. Off the top of my head, I don't recall how set startup scripts in FC, but I am sure Google does.

2. Auto login? You do know that is really insecure, I hope. Here's how:

3. Do you want the whole machine to shut down, or just certain services? If the machine, why? Linux is pretty stable. I suppose if you pay a lot for power, but...either way, you want a cron (or anacron or whatever) job. Definitely do a 'man cron' and 'man crontab' at a minimum if you aren't familiar with cron. Here are two pages that should help you get started:

for log messages, check /var/log/messages. That may give you some idea as to why your machine shut down.

Can't help with the email-sorry about that. Setting up email can be a tricky thing-the servers tend to be easy to set up with security holes, so I won't even go there.

You sound like you are new to the Linux world. Welcome! You should note that I found the above links using Google in less than 5 minutes, although I did know what I was looking for. I know sometimes you just don't know what to search for, but I suggest you try web searches first because many folks will simply ignore forum posts that can basically be answered by Google searches, which will greatly annoy you.
Old 05-31-2007, 11:45 PM   #3
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
1) Yes there are two ways of running VNC server automatically. Once it logs in as a user, of course you can have it execute as a startup in the user's .bashrc or .profile or something like that (these files are hidden in user's home directory). The system startup scrips alone won't work because vnc requires to be run from a valid logged in user and the system startup scripts run before the user logs in. The second way of running vncserver is to run it "as a service" where once connecting you get a login prompt much like the MS Windows Terminal-server/Remote-desktop system. I've never set it up this way but I think the instructions are on the realvnc website over in the UK. Look for "running vnc from inet.d" or just google it.

2) Yea, this is normally discouraged, but I guess if you have the server locked away in a secure location, it's not so bad. It is just that a lot of people run Linux servers and never seem to see a need for such action. Maybe you trying to do something in an awkward way?

3) This is an even stranger request. Why do you need this? About the only time I need to reboot a Linux server is when I change update a kernel and now with kexec I guess you don't even need to do it then! I suppose if you are running one of those bad-news binary-only kernel modules that has a memory leak or something, you might have to do something like this, but people generally avoid using such hardware like high end 3D video cards or flaky-supported network hardware in Linux servers for this reason.

4) This is a feature of many BIOS of modern computers. You might see if the BIOS in your computer has the ability to auto-restart after an improper system shutdown.
Old 06-01-2007, 12:21 AM   #4
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
2) Why do you need an automatic login on a headless (no monitor) system?

3) I suppose that you can run a shutdown -r command from cron

4) Newer BIOSes have the option to restore to the previous power state after a power failure; so if the machine was off, it will stay off after a power failure but if it was on, it will turn itelf on after a power failure
Old 06-01-2007, 09:36 AM   #5
LQ Newbie
Registered: Feb 2004
Distribution: Redhat 9
Posts: 1

Rep: Reputation: 0
regarding Q1 about vncserver, i'm not really sure what you want to do, but it seems you want a vncserver to start up on reboot. ? have a look at /etc/rc.d/init.d/vncserver which uses /etc/sysconfig/vncservers as a config file.

in /etc/sysconfig/vncservers you can set up an string of users/ports to start up, as well as an array of configuration options for each of them. for example, if you want user user1 to start a vncserver on port 10 and user2 on port 20, with display options of "-geometry 1176x950 -depth 24" you would have the following:

VNCSERVERS="10:user1 20:user2"

VNCSERVERARGS[10]="-geometry 1176x950 -depth 24"
VNCSERVERARGS[20]="-geometry 1176x950 -depth 24"

hope that helps.

Last edited by guymatz; 06-01-2007 at 09:39 AM. Reason: tried to get rid of the smiley created by :p when i wanted to write users:ports
Old 06-01-2007, 10:35 AM   #6
LQ Newbie
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0

I would use xinetd to setup vnc on demand, and set it to login using XDMCP.

This is from Linux Server Hacks, but gives you the general idea:

Create the file /etc/xinetd.d/vnc containing:

# default: on
# description: vncserver provides remote desktop connections
service vnc
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = :8 -inetd -once -query localhost -depth 24 -geometry 1024x768 -securitytypes=none

The server_args line should be one contiguous line. Then in Gnome or KDE enable XDMCP. Then when you try to connect using vncviewer you'll get a graphical login greeter. That's the gist of it, your mileage may vary.

As for automatic reboots and automatic logging in, I don't see any reason why you would want to do either.
Old 06-02-2007, 01:52 AM   #7
Registered: May 2007
Location: Brisbane, Australia
Distribution: Fedora 8/9, Xandros (eeepc)
Posts: 110
Blog Entries: 1

Rep: Reputation: 15
Originally Posted by Virtuality
1. Make it automatically run 'vncserver' in a terminal so I don't have to do that blindly (or switching monitor over) to start it.
Nice and easy in FC6. From a terminal run 'setup'. Go to Services, scroll down to vncserver and select it Not forgetting to edit /etc/sysconfig/vncservers as per an earlier post.
Old 06-11-2007, 12:28 PM   #8
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Rep: Reputation: 39
# chkconfig vncserver on
# cp /etc/inittab /etc/inittab.backup && cat /etc/inittab | sed 's/1:2345:respawn:\/sbin\/mingetty tty1/1:2345:respawn:\/bin\/bash tty1/' > /etc/inittab
I use autologin only for kiosk terminals so that guests may use the station rightaway.

# crontab -e
then enter this to poweroff at midnight +5 minutes:
00 00 * * * /sbin/shutdown -h +5
You may power up again by bios wakeup...

But perhaps a energy saving function would be wiser.

Last edited by brianmcgee; 06-11-2007 at 12:29 PM.


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
Quake3 Server, always 999 ping, can't figure it out stormblast Linux - Games 0 08-15-2004 01:10 PM
Mandrake 9 server went down. How do I figure out what caused it? bonzo Linux - Networking 1 08-10-2004 06:39 PM
I can't figure out what kind of monitor connector is on my SGI Origin 200 server. Travis86 Linux - Hardware 10 03-03-2004 01:50 PM
half life server? Total Newbie Can't figure out bin files Facekhan Linux - Newbie 7 08-20-2003 10:45 AM
retard can't figure out simple things Karnak Linux - Hardware 13 10-05-2002 12:02 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:53 PM.

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