LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   schedule hibernate (https://www.linuxquestions.org/questions/linux-newbie-8/schedule-hibernate-504190/)

AZaraT 11-23-2006 06:38 AM

schedule hibernate
 
Hey there

Im using ubuntu server and i wonna set it on hibernate lets say for 4hours every week(so it start up again after the 4 hours) at a specific time, I'm pretty sure it's possible, but im a noob, so I didn't figured it out.

As said im a linux noob so a would be awesome if someone could explain it detailed how i do.

And allso, i decided to install X, but i wonna startup in console mode, how do I do that ?

Hope someone can help
Cheers
AzaraT

notapplicable 11-23-2006 12:22 PM

Quote:

And allso, i decided to install X, but i wonna startup in console mode, how do I do that ?
This depends on the distribution you're using, but there's a file, /etc/inittab, that you'll need to edit (in superuser mode.) so that your box won't automatically put you in X.

Find 'id:[number]:initdefault:' near the top of the file (the number can be any number between 0 and 6; I don't know what your /etc/inittab looks like) and, depending on which distribution you're using, you replace that number with some other number between 0 and 6 that will put you in text mode on startup.

Copy and replace 'id:[number]:initdefault:' with the stuff below depending on your distribution. Remove all quotes.

o For most distros: 'id:3:initdefault:'
o For Debian, things get a little tricky... reply for more information.

Edit: I didn't notice that you run Ubuntu, sorry.
This is what you'll need to do (forget everything I said about /etc/inittab):

o open up a terminal (as root)

o type 'cd /etc/rcS.d' without quotes

o type 'ls' and find the one(s) that have anything to do with x11 (ex: S70x11-common).

o assuming the only one you have is S70x11-common, then type 'mv S70x11-common K70x11-common' if you have more, then do the same with the rest.

o Now, check the top of inittab to see which number is between the "id" and "initdefault." type 'cd /etc/rc[number].d' and type 'ls' to find the one that has gdm in it (mine is S21gdm, yours might be different) , and type 'mv S21gdm K21gdm' replace '21' with the number between S and gdm.

o Voila! Reboot, and see if it worked.

AZaraT 11-24-2006 05:10 AM

Thanks for the reply.

However i can't find the inittab file
Quote:

Now, check the top of inittab to see
I looked in /etc but didn't found anything ??

EDIT: okay nevermind, i found another way to do this, there is some menu which allowed me to turn GDM off, so it start in console now..


So another question (yeah yeah i know im asking alot) i want my CS server to startup when it boots, so i did this

sudo crontab -e

and then i inserted : @reboot /home/server/bla/bla....

but it doesn't really works, when i open crontab -e it says that the file is saved correctly so shouldn't it work ?

notapplicable 11-24-2006 01:09 PM

Wow. Ubuntu doesn't have an inittab. That's kind of disappointing. There are easier ways to do it than using crontab.

I'm assuming you use GNOME, so you could go to system -> preferences -> sessions. Then, wait for the window to open, and click the rightmost tab, "Startup Programs." Click "Add" (on the right). The rest should be self explanatory.
---------------

If you don't use GNOME, and you occasionally use your virtual terminals not running X, then you'd want to run it at the system's startup. Mind getting your hands a little dirty? Write a bourne shell script:

#!/bin/sh
[insert whatever command you use to start your CS server here]

Save it as csServer.sh or something, and then, in terminal, type 'chmod +x csServer.sh'. Without the quotes. Then, type 'sudo mv csServer.sh /etc/init.d/' without the quotes, and type 'sudo update-rc.d csServer.sh defaults' without the quotes. That should do the job.

AZaraT 12-17-2006 10:12 AM

uh, been a while haven't got any time at all the last weeks...

But its working thanks for the help mate! :D


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