Sunday, January 13, 2013

When I try to start Ubuntu normally, it goes into a command prompt, rather than the graphical set. Fix?

Q. And when I get to the command prompt, I get a line asking me to log in. If I wait a moment, it will say that "low memory is corrupted on XxxxxxX etc," I go into recovery mode to fix the packages, but it didn't download anything. therefore, not fixing it, I run in the failsafe graphics mode, and it works. I dual boot with Windows 7. How do I fix this?

A. May be something to do with Run Level.

Linux has 7 different run levels (or operating modes):

* rc0.d - System Halted
* rc1.d - Single User Mode
* rc2.d - Single User Mode with Networking
* rc3.d - Multi-User Mode - boot up in text mode
* rc4.d - Not yet Defined
* rc5.d - Multi-User Mode - boot up in X Windows
* rc6.d - Shutdown & Reboot

Each mode has it's own list of settings for what services to start and what services to shutdown. Not only does this list contain what is supposed to be running, but also what order each service should be started in - a feature many Linux lovers like to point out that Windows lacks..

chkconfig - will list all the registered services and display thier status at each different run level.

Most of the time when your server boots up it will start in runlevel 3 or 5 depending on what it is set to. This setting can be found in the file /etc/inittab

If you ever want to change what mode your server defaults to on bootup, just edit that file, but NEVER change it to runlevel 6 or 0. This will cause your server to shutdown on bootup or if you set it to runlevel 6 it will continuously reboot. I guess this could make a great prank on a friend's workstation.
RC.D Directory Explanation

In the folder: /etc/rc.d are all the run level folders starting from rc1.d to rc6.d and including init.d

It is in each of these rc#.d folders where the service run settings are kept. If you change directory into /etc/rc.d/rc3.d all the files that start with a capital S are the services that will start at this runlevel. All the files that start with a K are the services that will be killed at that runlevel.

The reason why services that are not supposed to run are still listed is because it is popular to switch a server from one run level to another instead of just booting into the needed run level. That way you can take your server offline (single user mode) and then apply a patch or do a file restore.

Let's take a closer look at these files that are inside the rc#.d folders. Notice that they are symbolic links to the script file located in /etc/rc.d/init.d This makes things very easy. All the commands to start, stop, or reload a service are handled by these scripts. So when a server is to go into a specific run level it can find the correct script and knows whether to start it based on its name and link path.

How to: Schedule my PC to shutdown at a certain time?
Q. Hey!
I just wanted to know how I could make like some sort of task where I could make my PC shutdown/hibernate at a certain hour. However I want it to do this only on certain days of the week. I hope you guys could help me and I'm even willing to install a program to make this possible!

Thanks in advance!

A. Use the "scheduled tasks" item in yoru control panel (Windows - assumed)
Basically, at the command line you would have
> at ( time)
+
> shutdown / (flags /t = time in seconds, mandatory.. other flags, see /?)

so to FORCE a shutdown and a RESTART (just for demo) in 90 seconds
one time, I would do - > shutdown /f /r /t 90

To schedule it for later on, ( /yes - force close if needed)
> AT 2200 /yes /every:Mon,Tue,Wed "shutdown /f /r /t 90"
... or something similar.. I haven't used this in a while, so it may need a tweak with spaces or flags.

It is probably easier - you just check the boxes(for days), fill in the time, and give the command in using the TASK SCHEDULER.

If you are using Mac or Linux (Mac since OSX is BSD Linux underneath).. the similar command would be setting a CRON job ( CRON is closest to AT)

In linux how do I set a time for my computer to shut down?
Q. Is there a way I can leave my computer on to download something but have it set so that it stops the download and shuts down at a certain time?
I'm using dream linux.

A. you can use the command "shutdown -P time". With this command, the computer will shutdown after the given time in minutes. For ex: "Shutdown -P 30" will turn off the computer after 30 minutes

Other possibilities are to use "at" or "cron",
"at" will automatically perform a given command at the given time only once (remember that: only once).
"cron" will repetitively perform the given command at every given time (for ex: every hour, every day or every month, etc...
For explication of "at" and "cron": you can see this page: http://www.linux.org/lessons/interm/c622.html

In your situation, Using "shutdown" is the best because your task isn't repetitive and "shutdown" is much more easier to use than "at" or "cron".




Powered by Yahoo! Answers

No comments:

Post a Comment