LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up an energy efficient server -- Windows better than Linux? (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-an-energy-efficient-server-windows-better-than-linux-414581/)

eppur_si_muove 02-12-2006 12:20 PM

Setting up an energy efficient server -- Windows better than Linux?
 
Hi everyone -- I am new to Linux, using Xandros for the first time on a home server to share files and backup lots of Windows XP clients. I want to administer this server in the most energy efficient way.

I have succeeded in using "Wake on LAN" to remotely powerup the Linux server from the Windows clients. But I cannot find a way to remotely shutdown the Linux server from the Windows clients. I don't want to run the server on a timer, because the uptime I need will vary on different occasions. I want the Linux server shutdown to occur when demanded by a client.

In Windows, there are many freeware tools allowing a client to remotely shutdown a Windows server when it's not needed, saving about 100 watts of electricity (=$90 a year). Here's one of them:

users.pandora.be/jbosman/poweroff/poweroff.htm

Others I've asked say there is not an equivalent tool I can run on my Windows XP clients to remotely shutdown a Linux server. Really? I'll throw this out as a challenge to all the Linux partisans on this list, because as it now appears, for an energy efficient, ecologically responsible server, Windows beats Linux. Ideas anyone?

Thanks - Amir

gilead 02-12-2006 01:11 PM

It sounds like you need hardware that supports hibernate modes, a kernel with support for those power saving modes and SSH so you can remote in and issue commands. I haven't tried this - there's a lot of different metrics I've seen over the years for evaluating Linux servers but being able to shut one down from Windows isn't one of them ;)

Tinkster 02-12-2006 02:29 PM

It could be done as easily as writing a shell-script that shuts
the sever down, and access that script from /etc/hosts.allow when
the box is being contacted on a given port. All it would take
on the windows box is a bookmark to http://server:port , you click
that, and down she goes ...


Cheers,
Tink

eppur_si_muove 02-12-2006 04:04 PM

Tink, thank you for that suggestion. Write a script? As in my own program?? It's intriguing, but I've never done that before, and "just" learning to write scripts is not on the cards.

Is there no easy way for a person VERY new to Linux servers (that is, me) to configure existing options in the Xandros distro, or to install someone else's program, to enable a client to shutdown the server by remote command? There must be a dozen freeware programs available which enable Windows servers to do exactly that.

It's easy to deride Windows and Microsoft for making heaps of money, but if they make it easier for home users to set up energy efficient and ecological servers, that is a very big deal. Any ecologically-minded coders out there?

Tinkster 02-12-2006 04:08 PM

Well ... it's next to trivial if you have putty on the windows
box, really. Open a session to the server and do
sudo /sbin/poweroff

Slightly safer against accidental shutdowns ;)


Cheers,
Tink

eppur_si_muove 02-12-2006 04:16 PM

Yes, telnetting from Windows to the Linux box is one option, and I struggled mightily to make it work before posting my question on this list. Trouble is, whenever I attempt to telnet to the Linux box, it won't accept the connection. In the time it would take me at my skill level to diagnose the hitch in the Xandros distro which rejects incoming telnet requests, I could reinstall Windows XP on the server.

Again, I'm after a SIMPLE, direct, minimally inventive solution here please: a solution which resembles "click to shut down server". That kind of simplicity is just imperative, if a household of non-experts are going to use it correctly. In the interest of finding that solution, please don't post to this thread unless it's a suggestion aimed at that outcome.

gilead 02-12-2006 04:26 PM

If all you're doing is using the Linux box to hold shared files and backups - why not just get an external hard drive and plug it into your USB port when you need it. You can create a Windows share so that other users can see it.

I should point out that I wasn't deriding MS or Windows. Also, it's not MS making it easier for you to do this under Windows - it's software developers who are providing their work free of charge :)

eppur_si_muove 02-12-2006 04:50 PM

Yes, thanks for the clever alternative, but it's not what I asked. Can we stay on topic please? How to make a Linux sever shut down remotely and easily????

arno 02-12-2006 05:05 PM

Create a new user
and add the following script to its .profile
nohup shutdown -now

If you login to your system with that user account it with shutdown.
if shutdown is allowed by that user

eppur_si_muove 02-12-2006 05:16 PM

Arno, how to trigger the shutdown from a Windows client then? I don't see that.

arno 02-12-2006 05:18 PM

You use telnet on a windows pc to login on your linux box

Emerson 02-12-2006 05:25 PM

Quote:

Originally Posted by Tinkster
Well ... it's next to trivial if you have putty on the windows
box, really. Open a session to the server and do
sudo /sbin/poweroff

Slightly safer against accidental shutdowns ;)

What is wrong with this advice? Telnet is deprecated and your Xandros probably does not have the telnet server running, but I'm sure it has ssh server running.

arno 02-12-2006 05:44 PM

Sorry I missed the fact that telnet was not an option.

Create a script with a loop in it and a sleep timer, let the script test is a map contains a file.
If the script finds a file then remove that file and start the shutdown instruction.
Make sure that the script is active after the system startup.


Setup ftp or samba to give a certain user access to that map to write a file

shaunw 02-12-2006 06:50 PM

Everything for free
 
Essentially it seems you want a free operating system and
some free programming to make it do what you want it to do
and you want to save money on your electricity bill.
Try giving something for a change instead of demanding things
from other people.
Just stick to paying for Windows instead of wasting your time
annoying people on this site.
Is this on topic and concise enough for you?

Tinkster 02-12-2006 06:56 PM

Quote:

Originally Posted by eppur_si_muove
Yes, thanks for the clever alternative, but it's not what I asked. Can we stay on topic please? How to make a Linux sever shut down remotely and easily????

I really must say that I find the tone of your last couple
of responses quite obnoxious. You're coming here, getting
advice from people for free (in their own spare time) and
you're making demands as to what kind of advice it's got
to be?

"I want that free car, but can't be bothered to learn stick,
make it an automatic, and quickly."


Cheers,
Tink


All times are GMT -5. The time now is 11:34 AM.