Specializes in reporting on news stories and events from practically every major category and subcategory you could imagine—including world news, entertainment, politics, business, style, and several others
Showing posts with label daily articles. Show all posts
Showing posts with label daily articles. Show all posts
Wednesday, October 31, 2012
How Linux OS boots
How Linux boots
As it turns out, there isn't much to the boot process:
1. A boot loader finds the kernel image on the disk, loads it into memory, and starts it.
2. The kernel initializes the devices and its drivers.
3. The kernel mounts the root filesystem.
4. The kernel starts a program called init.
5. init sets the rest of the processes in motion.
6. The last processes that init starts as part of the boot sequence allow you to log in.
Identifying each stage of the boot process is invaluable in fixing boot problems and understanding the system as a whole. To start, zero in on the boot loader, which is the initial screen or prompt you get after the computer does its power-on self-test, asking which operating system to run. After you make a choice, the boot loader runs the Linux kernel, handing control of the system to the kernel.
There is a detailed discussion of the kernel elsewhere in this book from which this article is excerpted. This article covers the kernel initialization stage, the stage when the kernel prints a bunch of messages about the hardware present on the system. The kernel starts init just after it displays a message proclaiming that the kernel has mounted the root filesystem:
VFS: Mounted root (ext2 filesystem) readonly.
Soon after, you will see a message about init starting, followed by system service startup messages, and finally you get a login prompt of some sort.
NOTE On Red Hat Linux, the init note is especially obvious, because it "welcomes" you to "Red Hat Linux." All messages thereafter show success or failure in brackets at the right-hand side of the screen.
Most of this chapter deals with init, because it is the part of the boot sequence where you have the most control.
init
There is nothing special about init. It is a program just like any other on the Linux system, and you'll find it in /sbin along with other system binaries. The main purpose of init is to start and stop other programs in a particular sequence. All you have to know is how this sequence works.
There are a few different variations, but most Linux distributions use the System V style discussed here. Some distributions use a simpler version that resembles the BSD init, but you are unlikely to encounter this.
Runlevels
At any given time on a Linux system, a certain base set of processes is running. This state of the machine is called its runlevel, and it is denoted with a number from 0 through 6. The system spends most of its time in a single runlevel. However, when you shut the machine down, init switches to a different runlevel in order to terminate the system services in an orderly fashion and to tell the kernel to stop. Yet another runlevel is for single-user mode, discussed later.
The easiest way to get a handle on runlevels is to examine the init configuration file, /etc/inittab. Look for a line like the following:
id:5:initdefault:
This line means that the default runlevel on the system is 5. All lines in the inittab file take this form, with four fields separated by colons occurring in the following order:
# A unique identifier (a short string, such as id in the preceding example)
# The applicable runlevel number(s)
# The action that init should take (in the preceding example, the action is to set the default runlevel to 5)
# A command to execute (optional)
There is no command to execute in the preceding initdefault example because a command doesn't make sense in the context of setting the default runlevel. Look a little further down in inittab, until you see a line like this:
l5:5:wait:/etc/rc.d/rc 5
This line triggers most of the system configuration and services through the rc*.d and init.d directories. You can see that init is set to execute a command called /etc/rc.d/rc 5 when in runlevel 5. The wait action tells when and how init runs the command: run rc 5 once when entering runlevel 5, and then wait for this command to finish before doing anything else.
There are several different actions in addition to initdefault and wait, especially pertaining to power management, and the inittab(5) manual page tells you all about them. The ones that you're most likely to encounter are explained in the following sections.
respawn
The respawn action causes init to run the command that follows, and if the command finishes executing, to run it again. You're likely to see something similar to this line in your inittab file:
1:2345:respawn:/sbin/mingetty tty1
The getty programs provide login prompts. The preceding line is for the first virtual console (/dev/tty1), the one you see when you press ALT-F1 or CONTROL-ALT-F1. The respawn action brings the login prompt back after you log out.
ctrlaltdel
The ctrlaltdel action controls what the system does when you press CONTROL-ALT-DELETE on a virtual console. On most systems, this is some sort of reboot command using the shutdown command.
sysinit
The sysinit action is the very first thing that init should run when it starts up, before entering any runlevels.
How processes in runlevels start
You are now ready to learn how init starts the system services, just before it lets you log in. Recall this inittab line from earlier:
l5:5:wait:/etc/rc.d/rc 5
This small line triggers many other programs. rc stands for run commands, and you will hear people refer to the commands as scripts, programs, or services. So, where are these commands, anyway?
For runlevel 5, in this example, the commands are probably either in /etc/rc.d/rc5.d or /etc/rc5.d. Runlevel 1 uses rc1.d, runlevel 2 uses rc2.d, and so on. You might find the following items in the rc5.d directory:
S10sysklogd S20ppp S99gpm
S12kerneld S25netstd_nfs S99httpd
S15netstd_init S30netstd_misc S99rmnologin
S18netbase S45pcmcia S99sshd
S20acct S89atd
S20logoutd S89cron
The rc 5 command starts programs in this runlevel directory by running the following commands:
S10sysklogd start
S12kerneld start
S15netstd_init start
S18netbase start
...
S99sshd start
Notice the start argument in each command. The S in a command name means that the command should run in start mode, and the number (00 through 99) determines where in the sequence rc starts the command.
The rc*.d commands are usually shell scripts that start programs in /sbin or /usr/sbin. Normally, you can figure out what one of the commands actually does by looking at the script with less or another pager program.
You can start one of these services by hand. For example, if you want to start the httpd Web server program manually, run S99httpd start. Similarly, if you ever need to kill one of the services when the machine is on, you can run the command in the rc*.d directory with the stop argument (S99httpd stop, for instance).
Some rc*.d directories contain commands that start with K (for "kill," or stop mode). In this case, rc runs the command with the stop argument instead of start. You are most likely to encounter K commands in runlevels that shut the system down.
Adding and removing services
If you want to add, delete, or modify services in the rc*.d directories, you need to take a closer look at the files inside. A long listing reveals a structure like this:
lrwxrwxrwx . . . S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx . . . S12kerneld -> ../init.d/kerneld
lrwxrwxrwx . . . S15netstd_init -> ../init.d/netstd_init
lrwxrwxrwx . . . S18netbase -> ../init.d/netbase
...
The commands in an rc*.d directory are actually symbolic links to files in an init.d directory, usually in /etc or /etc/rc.d. Linux distributions contain these links so that they can use the same startup scripts for all runlevels. This convention is by no means a requirement, but it often makes organization a little easier.
To prevent one of the commands in the init.d directory from running in a particular runlevel, you might think of removing the symbolic link in the appropriate rc*.d directory. This does work, but if you make a mistake and ever need to put the link back in place, you might have trouble remembering the exact name of the link. Therefore, you shouldn't remove links in the rc*.d directories, but rather, add an underscore (_) to the beginning of the link name like this:
mv S99httpd _S99httpd
At boot time, rc ignores _S99httpd because it doesn't start with S or K. Furthermore, the original name is still obvious, and you have quick access to the command if you're in a pinch and need to start it by hand.
To add a service, you must create a script like the others in the init.d directory and then make a symbolic link in the correct rc*.d directory. The easiest way to write a script is to examine the scripts already in init.d, make a copy of one that you understand, and modify the copy.
When adding a service, make sure that you choose an appropriate place in the boot sequence to start the service. If the service starts too soon, it may not work, due to a dependency on some other service. For non-essential services, most systems administrators prefer numbers in the 90s, after most of the services that came with the system.
Linux distributions usually come with a command to enable and disable services in the rc*.d directories. For example, in Debian, the command is update-rc.d, and in Red Hat Linux, the command is chkconfig. Graphical user interfaces are also available. Using these programs helps keep the startup directories consistent and helps with upgrades.
HINT: One of the most common Linux installation problems is an improperly configured XFree86 server that flicks on and off, making the system unusable on console. To stop this behavior, boot into single-user mode and alter your runlevel or runlevel services. Look for something containing xdm, gdm, or kdm in your rc*.d directories, or your /etc/inittab.
Controlling init
Occasionally, you need to give init a little kick to tell it to switch runlevels, to re-read the inittab file, or just to shut down the system. Because init is always the first process on a system, its process ID is always 1.
You can control init with telinit. For example, if you want to switch to runlevel 3, use this command:
telinit 3
When switching runlevels, init tries to kill off any processes that aren't in the inittab file for the new runlevel. Therefore, you should be careful about changing runlevels.
When you need to add or remove respawning jobs or make any other change to the inittab file, you must tell init about the change and cause it to re-read the file. Some people use kill -HUP 1 to tell init to do this. This traditional method works on most versions of Unix, as long as you type it correctly. However, you can also run this telinit command:
telinit q
You can also use telinit s to switch to single-user mode.
Shutting down
init also controls how the system shuts down and reboots. The proper way to shut down a Linux machine is to use the shutdown command.
There are two basic ways to use shutdown. If you halt the system, it shuts the machine down and keeps it down. To make the machine halt immediately, use this command:
shutdown -h now
On most modern machines with reasonably recent versions of Linux, a halt cuts the power to the machine. You can also reboot the machine. For a reboot, use -r instead of -h.
The shutdown process takes several seconds. You should never reset or power off a machine during this stage.
In the preceding example, now is the time to shut down. This argument is mandatory, but there are many ways of specifying it. If you want the machine to go down sometime in the future, one way is to use +n, where n is the number of minutes shutdown should wait before doing its work. For other options, look at the shutdown(8) manual page.
To make the system reboot in 10 minutes, run this command:
shutdown -r +10
On Linux, shutdown notifies anyone logged on that the machine is going down, but it does little real work. If you specify a time other than now, shutdown creates a file called /etc/nologin. When this file is present, the system prohibits logins by anyone except the superuser.
When system shutdown time finally arrives, shutdown tells init to switch to runlevel 0 for a halt and runlevel 6 for a reboot. When init enters runlevel 0 or 6, all of the following takes place, which you can verify by looking at the scripts inside rc0.d and rc6.d:
1. init kills every process that it can (as it would when switching to any other runlevel).
# The initial rc0.d/rc6.d commands run, locking system files into place and making other preparations for shutdown.
# The next rc0.d/rc6.d commands unmount all filesystems other than the root.
# Further rc0.d/rc6.d commands remount the root filesystem read-only.
# Still more rc0.d/rc6.d commands write all buffered data out to the filesystem with the sync program.
# The final rc0.d/rc6.d commands tell the kernel to reboot or stop with the reboot, halt, or poweroff program.
The reboot and halt programs behave differently for each runlevel, potentially causing confusion. By default, these programs call shutdown with the -r or -h options, but if the system is already at the halt or reboot runlevel, the programs tell the kernel to shut itself off immediately. If you really want to shut your machine down in a hurry (disregarding any possible damage from a disorderly shutdown), use the -f option.
Thursday, October 18, 2012
7 Businesses You Can Start at Home
By Erin Crum, eHow
If you want to work for yourself or want more time to spend with family, starting a home-based business might be the perfect solution. From selling handcrafted goods to online blogging, there are many options when it comes to starting your own business without a ton of money or a ton of space. Check out a few of the home-based business you could have up and running in no time.
If you want to work for yourself or want more time to spend with family, starting a home-based business might be the perfect solution. From selling handcrafted goods to online blogging, there are many options when it comes to starting your own business without a ton of money or a ton of space. Check out a few of the home-based business you could have up and running in no time.
Artisan
If you enjoy making crafts such as jewelry, home decor or pottery, consider starting a small business selling your creations through an online marketplace like etsy.com. Create the items that you would like to sell and take photos of each piece. Then list the items on the website and pay a small fee for each item listed. Shoppers find your item on the website, send you payments and you ship the items directly to the customers. It's a great way to put your creativity to work as your own small business.
Blogger
Successful bloggers can earn a full-time income through online posts, articles and regular columns. You can start your own blog through websites like blogger.com or tumblr.com. Find an area of expertise or a topic that you are passionate about and start writing about the latest news and share tips or insight in field. Sign up for a "pay-per-click" account by visiting a site such as Google Adsense, which puts advertisements on your blog. The more visitors to your site, the more opportunity to make money when visitors click on one of these ads.
Customer Support
Many companies outsource their in-bound customer service phone calls to work-from-home employees. Take phone calls directly from customers who have questions or need assistance in purchasing items. The requirements are that you must have customer service experience, a landline and internet access. Companies such as Alpine Access, LiveOps, West and Arise hire virtual customer service agents who work out of their homes.
Bookkeeper
If you are good with numbers and find yourself always helping out friends during tax season, put your skills to work. By starting your own bookkeeping business, you can sell your own services to individuals and small businesses while working from home. You will need accounting software and a reliable computer. Attract new clients by posting flyers and sending out mailings to other small businesses in your area.
Tutor
If you enjoy teaching, start you own home-based business tutoring students in your area of expertise. You can tutor students at their homes, in your home or at a library. Contact community groups and local schools to see how you can work with students who could use extra academic support. You can also join a online network and tutor students virtually, over the internet.
Translator
If you speak more than one language fluently, become a freelance translator. Many companies need paperwork and documents translated by fluent or native language speakers. Find freelance translating work through Welocalize.com or sdl.com. You will need to pass a language fluency test and have good grammar and punctuation.
Monday, May 14, 2012
10 Careers for People Who Love to Travel
Flight Pictures Would you like to travel the world and get paid for it at the same time? Join the club. See more pictures of flight.
John Rowley/Getty Images
Some people's idea of a vacation is visiting their in-laws on the other side of town. Others want to get away at any and every opportunity -- the farther away the better. If given the chance, they'd climb Mt. Kilimanjaro one day and compare Impressionists at the Louvre the next.
These intrepid travelers will brave any terrain or climate. They'll even repeatedly subject themselves to airport securityjust for the chance to go somewhere new.
If you get twitchy staying in the same place for too long, why settle for a few measly vacations a year? Satisfy your wanderlust on every one of those 365 days by embarking on a career that will have you really going places -- and not just up the corporate ladder.
When you think about travel jobs, the travel industry (pilot, flight attendant) probably jumps to mind, but there are also many not-so-obvious career options for people who like to get around. We've searched the globe and found 10 of the best careers for people who love to travel. So update your resume, pack your bags and get ready to explore.
10: Travel Nurse
These days, good nurses are in high demand and short supply. That nursing shortage can work to your advantage if you're trained and capable.
You could always get a job at your local hospital, but then you'd be dealing with the same responsibilities and working with the same people every day. Or you could travel around the country going from one hospital gig to another and caring for people in many different cities.
Travel nurses temporarily fill open positions wherever they're needed. You might tend to a jellyfish sting in Hawaii one day and nurse a broken leg in Aspen the next. Labor and delivery nurses, emergency roomnurses, and operating room nurses are just a few of the positions that are in constant high demand around the country.
As a travel nurse, you'll work for a company that will provide you with accommodations (often a furnished home), a travel stipend to help you get from one hospital to another and a very competitive salary that is usually higher than what permanent nurses earn.
To make a great athletic scout, you have to know how to spot extraordinary talent in others.
©iStockphoto.com/arenacreative
9: Athletic Scout
How do basketball players make the leap from the high school court to the NBA? How does a football player go from the college bowl to the Super Bowl? Athletes wouldn't be able to achieve their dreams without the help of athletic scouts.
Athletic scouts work for colleges and professional sports teams, or they can freelance for several different teams. Their job is to seek out the best and brightest young athletes and recruit them onto the teams they represent. To find those players, scouts scour newspaper and TV reports for stories of gifted athletes. They also have to sit through a lot of high school or college games around the country, and sometimes abroad.
To make an effective athletic scout, you need to know your sport inside and out from playing it, coaching it or watching it incessantly. You also need to have a knack for spotting young talent on the field and court. Pro teams and colleges shell out a lot of money for scholarships and contracts, and they want their investment to pay off with winning players. That means athletic scouts are under a lot of pressure to find good talent.
8: Roadie
Who hasn't dreamed of going out on the road with the Rolling Stones or U2? How many music fans have imagined traveling from gig to gig and hanging with their favorite band? If the touring part of being in a road crew weren't exciting enough, there's also the thrill of working with some of the biggest names in the music and entertainment business.
Road crew members -- affectionately known as roadies -- are the folks who handle the stage productions for touring acts. Lighting and sound engineers, riggers, stagehands and instrument technicians are all considered roadies.
As with most jobs, you've got to pay your dues to make it in the roadie business. You'll probably start out lugging around lighting and sound equipment at a small venue or theater to start. Once you've learned the ropes, and with a little luck, you can work your way up to touring with the major music acts.
If you want to be a tour guide, you've got to be knowledgeable and resourceful
©iStockphoto.com/leezsnow
7: Tour Guide
One of the most obvious career choices if you love to travel is to become a tour guide. In what other job can you spend your days exploring cities like Athens, Rome or London -- and get paid for it?
Every city that attracts tourists needs tour guides. Some guides work for a particular location (such as a museum), while others lead themed tours (like ghost tours or historical bus tours). If you're particularly good at your job, you can eventually work your way up to become a director or even owner of a tour company.
To be a tour guide, you not only need to know your city inside and out -- its history, culture and hidden secrets -- but you also need to relate well to people. You've got to make your tour group feel comfortable in a city that's unfamiliar to them. Depending on the type of tour, you may also need to help them handle small emergencies that arise, from getting medical care to finding lost luggage.
If you're planning to be a tour guide abroad, it helps to speak another language (or two, or three) and to have a solid education in the history and culture of the area.
6: Civil Servant
If you want to work for the U.S. government and see the world at the same time, check with the U.S. Department of State. This government agency has hundreds of different job opportunities available for people who want to represent U.S. interests abroad. The government has 265 different embassies around the globe, as well as many other offices where people can work in civil service jobs.
Whether your background is in engineering, security, accounting, healthcare, management, IT or operations, there's probably a civil service position related to your skills. Civil service jobs not only give you the chance to travel, but many positions pay well and offer relocation, cost-of-living allowances and excellent benefits.
One caveat: If you haven't paid your taxes in a few years or you've broken the law a couple of times, you'll have to satisfy your wanderlust in a nongovernment gig. The U.S. Department of State requires all civil service applicants to undergo a rigorous security clearance process that can take two to four months. They might even interview your friends, family members and neighbors.
As an international aid worker, you can travel the world and do some good at the same time.
Chris Hondros/Getty Images
5: International Aid Worker
While civil service employees represent America's interests in other countries, international aid workers export some of our abundant goodwill abroad. People who work for aid organizations like USAID and the Peace Corps work to improve the health, economic outlook and education of people living in developing nations.
International aid workers help countries that are struggling or recovering from economic crises, natural disasters, war, famine and despotism. Depending on their experience, aid workers might teach in Afghanistan, organize relief convoys to combat areas in Somalia, or introduce new heat-resistant crops to nations throughout Africa.
The desire to help others is a plus if you want to be an international aid worker -- but it's not the only prerequisite. You also need to have a background in a relevant area, like agriculture, engineering, private enterprise, education, health or crisis stabilization.
Becoming an international aid worker has its rewards -- and not just the gratification of helping people in other countries. Some international aid workers earn salaries well into the six figures.
4: Archaeologist
Imagine discovering the world's oldest known tool, or unearthing the skeleton of one of our very first ancestors. Every day, archaeologists are discovering the kinds of buried treasures that give them a glimpse into life thousands -- or even millions -- of years in the past.
The typical image of an archaeologist is a khaki-clad adventurer, up to his or her neck in dust on a dig. In movies and TV shows, archaeologists are typically found in countries like Egypt and other ancient civilizations.
Archaeologists do more than just dig, though. Once they make a great find, they have to identify and analyze their discoveries so they can be catalogued, restored and displayed by collectors or museums.
Some archaeologists don't dig at all. They conduct research for museums or governments, or teach archaeology at universities. Other archaeologists are in charge of protecting historic sites, excavating them for relics before construction crews can dig there and accidentally destroy an important piece of history.
Teaching English as a second language allows people to immerse themselves in a completely different culture while traveling the world and helping others.
PNC/Brand X Pictures/Getty Images
3: English Teacher
English is one of the world's most spoken languages. It helps connect diverse cultures and bridge the gap between countries that want to connect for trade or diplomacy. Many people in non-English-speaking countries have the desire to learn the language, so there's always a need for people who can teach English-as-a-second-language (ESL) classes abroad.
As an ESL teacher, you'll get paid for the privilege of being immersed in a different culture. Many English teachers are provided with free accommodations while they're working abroad. You'll also get the satisfaction of knowing that you're teaching a valuable skill.
You can either teach children from kindergarten through high school, or work with adults. Most positions require you to have at least a bachelor's degree, but you'll earn more if you also have a master's. Depending on the program, you might need to be certified to teach as well.
English teaching positions are available through the U.S. Department of State, as well as with companies that place teachers internationally. Asia and Eastern Europe are two of the biggest markets for English teachers today. You can work in private international schools and universities, U.S. military bases or with an organization like the Peace Corps.
2: Field Service Technician
Many jobs that allow you to travel also require you to have a four-year college degree -- and often an advanced degree. If you don't have that kind of education but you still want to travel, consider working as a field service technician. These mobile repair techs travel wherever they are needed to perform equipment maintenance and repair.
Field service technicians can work for the government, equipment manufacturers, computer repair companies or construction and transportation businesses.
You don't need a four-year degree to be a field service technician, but a two-year associate's degree and some technical training are helpful. Many companies offer on-the-job training, so after a few years of working in this industry, you should be highly qualified.
If you hit the lottery, you can travel the world on a yacht like this one. Even if you don't, working on one can be its own reward.
©iStockphoto.com/laughingmango
1: Professional Yacht Crew
Everyone dreams about what they'd buy if they hit the lottery. For a lot of people, a superyacht tops that lottery wish list.Superyachts are like floating mansions, packed every possible amenity that can fit on a super luxurious oceangoing vessel.
Instead of just dreaming about floating away on a private yacht, why not actually do it? A seven-figure salary isn't a requirement. You don't even need to have sailing experience.
Thousands of superyachts are floating around the world, from Sydney to Singapore. And most of those yachts need crews to keep them afloat. (Did you actually think Jay-Z and Beyonce sailed their own $40 million chartered superyacht on the French Riviera last summer?)
Yachts need captains to drive them, deckhands to maintain the exterior, stewardesses to dust and polish the interior, engineers to keep the engines running and chefs to satisfy the dining pleasures of the yacht's well-heeled occupants. Speaking of the occupants, yacht crews have the chance to meet some of the biggest names in business, politics and entertainment while they're sailing around the world and getting paid for it.
Watson, Stephanie. "10 Careers for People Who Love to Travel" 28 December 2010. HowStuffWorks.com.
Subscribe to:
Posts (Atom)