LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 05-31-2007, 08:22 PM   #1
Virtuality
Member
 
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, 11:44 PM   #2
Coldfire
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:
http://ubuntuguide.org/wiki/Fedora_f...8not_secure.29

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:

http://beau.org/pipermail/whitebox-u...il/006122.html

http://mailman.theapt.org/pipermail/...ly/001931.html

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 06-01-2007, 12:45 AM   #3
wartstew
Member
 
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, 01: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, 10:36 AM   #5
guymatz
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 10:39 AM. Reason: tried to get rid of the smiley created by :p when i wanted to write users:ports
 
Old 06-01-2007, 11:35 AM   #6
ctbfourone
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
vncserver

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, 02:52 AM   #7
wayno
Member
 
Registered: May 2007
Location: Brisbane, Australia
Distribution: Fedora 8/9, Xandros (eeepc)
Posts: 110
Blog Entries: 1

Rep: Reputation: 15
Quote:
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, 01:28 PM   #8
brianmcgee
Member
 
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Rep: Reputation: 38
1.
Code:
# chkconfig vncserver on
2.
Code:
# 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.

3.
Code:
# crontab -e
then enter this to poweroff at midnight +5 minutes:
Code:
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 01:29 PM.
 
  


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
Quake3 Server, always 999 ping, can't figure it out stormblast Linux - Games 0 08-15-2004 02:10 PM
Mandrake 9 server went down. How do I figure out what caused it? bonzo Linux - Networking 1 08-10-2004 07: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 02:50 PM
half life server? Total Newbie Can't figure out bin files Facekhan Linux - Newbie 7 08-20-2003 11:45 AM
retard can't figure out simple things Karnak Linux - Hardware 13 10-05-2002 01:02 PM


All times are GMT -5. The time now is 01:32 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration