Managing System Boot & Services / Troubleshooting Startup
Subtitles of the Movie
Now let's take a look at troubleshooting a BSD Unix startup process. Now, troubleshooting is an art as well as a science and there are things you can do to troubleshoot a bad startup and a bad startup might be defined as services that don't start properly, a computer that becomes locked up, hardware that's creating problems that's either newly-installed or possibly a corrupt device driver or something. Whatever the case may be, there are things that can happen during startup that you may want to troubleshoot and look at. Now, understand that troubleshooting can be a advanced and complex process so we're probably only going to scratch the surface a little bit of troubleshooting but we're going to give you a few tools you can use to look at some basic things. After all, this is just an essentials course and as you become more versed and experienced in Unix, you'll learn more how to troubleshoot more complex scenarios. One thing we'll look at is the D Message command. Now, D Message basically gives you all the logs that start up, all the messages when a Unix system starts up so you can look and see if there were any errors. Another thing that you can do is look at the /procVar /procLog /procMessages. This will tell you excruciating detail sometimes what happened on startup, such as the kernel drivers are loading, the file systems are mounted and so forth. You can also look at hardware and drivers. You can see what drivers are installed, possibly see which ones did not start properly and look at which ones are giving you trouble and then you either pull that piece of hardware out and restart to see if it is actually what it was or look at the drivers for that piece of hardware. Another thing you can do is check startup daemons. Check your Inetd.Conf file and if you need to, comment some things out that may be causing problems with startup or look at your rc.conf file and see what's actually starting up and look there as well. You may have to play around with a few things and turn certain services on and off before you arrive at the correction service that may be causing the problem. Another thing you can do sometimes is reboot in a single-user mode, which is Init 1 and that mode allows you to perform certain maintenance functions on the system without having to worry about multiple users being logged into the system and so forth. Or the processes that go along with those multiple users. It's a very slimmed-down version of Unix and only certain daemons and so forth start so it's kind of like safe mode in Windows. Not exactly like that but that's kind of the closest thing you could come to it. Let's go ahead and take a look at a few of these things that we've talked about when troubleshooting startup. OK, we're in our VMware BSD Unix box and the first thing we'd like to look at probably is D Message. Now, D Message, as I said, basically gives you all the startup message, messages, logs and errors and so forth when the computer's starting and it can be a little bit lengthy so we probably want to pop this into the less command and we can see where the computer started up and we can see the version number and so forth, available memory. We can look at ACP hardware starting up on the system and if we scroll here, we can see various pieces of hardware starting up. The AT and Serial ATA drives, PCI starting up, USB starting up and so forth so you can kind of get an idea of what hardware is starting up and what's located on different resources. And then this can be a rather lengthy file and you can see different pieces of hardware and different things, processes that have started to get the computer booted up. So you can get an idea if something didn't start that was supposed to or something errored out. You might see something in there about that so that might be a good place for you to start looking and as you can see, again, it's a rather lengthy file as we're paging through it here. Finally reached the end here. So D Message is a good place to start looking when you have a problem with startup. Another place to look as far as logs and messages go is the var/log/messages. Now, if we type in, let's clear this first, let's type in Less /procVar /procLogs /procMessages and if we take a look at that, Unix is very picky about what you type in so you have to make sure you type in the correct thing: log versus logs. And again, this is a lot of different messages that are being pumped into this last var/log/messages and you'll see different things; a lot of them similar to where we saw the D Message. This is a little bit more complex. This is akin to the Event Viewer in Windows. It's a lot like that. You can see where the system was shutdown and restarted and so forth. You can see where the kernel process is started, where hardware was loaded, drivers loaded and so forth. So you'll see successful things here and you may see some unsuccessful things that might show you where you need to start looking. You can see if there were any kernel dumps here and so forth and where they're at, what the memory looked like at the time. Again, what devices and drivers and things were loaded up. You just kind of page through here at the various things you'll see. You can get an idea what resources, such as IPs and stuff, hardware is using, what it should be using. There's just so much information in here and again, it takes a while, takes a little bit of experience with Unix to really get into this and figure out what a lot of these log entries mean so you're probably going to have to spend some time with this and I would recommend that if you're troubleshooting a startup by yourself, it's probably going to be a difficult process. You're probably going to have to troubleshoot this with someone who knows what they're doing, who has a little bit of experience looking at these logs and knowing what they wanted to see. So we look at var/log/messages. Some other things you might want to look at are file system information such as what's in the fstab file and we can look at that and we can see what devices are supposed to be mounted and where they're supposed to mount at and what their mount options are. Now, if you want to see what actually mounted, simply type in the Mount command and that'll show you that we mounted Device 80 0 /proc1A on Root, loaded the DEV FS on /dev and that tells you what actually loaded up. Now, notice that the CD-ROM did not mount up. It is in the FS tab. We'd have to mount that manually if we wanted so if you had trouble getting the CD-ROM, it might be because it hasn't mounted yet. Now, so there's some other things you need to check as well, like Check Services and we've shown you how to look at the services. We looked at the rc.conf file and INet.Conf and what you want to look for is services that start up, services that can be giving you potential problems or are not configured properly in these file. So if you've recently changed either those two files, the Inetd.Conf or the rc.conf, you really want to take a look at how those are set up and see if there's an error in those files. When all else is said, you also may want to look at going into the maintenance mode or single-user mode of Unix and that's actually done by simply typing in the INIT command and going to INIT 1 and if you got INIT 1, you're basically going to get a single-user, only the Root user is logged in, no other user can login and certain processes are stopped and started and so forth. So now you're basically in single-user mode. Now, another thing you can do once you've perform maintenance here, once you work in here, you don't have the problem of some processes that are started that shouldn't be started while you're working and then after this of course you can choose to reboot the system. If you reboot the system, one thing that's interesting with BSD Unix with Free BSD in particular is that once the system reboots you get an, actually a pretty decent menu and you'll get some things that you might not see or might not know how to get to otherwise. Let's go ahead and boot to Free BSD when I restart here and as you can see, you'll get Free BSD default. You can also troubleshoot by going to Free BSD with the ACPI disabled. There's also a Free BSD in safe mode, single-user mode and verbose login. So you can use those options as well to help you troubleshoot startup and kind of see what's going on when the computer starts up and see if you can fix it. Now again, this is going to take some experience and a little time so don't get too intimidated by it if you can't do it right now or right after taking this course. It's going to take a little bit of knowledge and experience to do this and some help sometimes. So we've covered some basics on troubleshooting startup and we've looked at various things such as D Message and looking at the var/log/messages, looking at the file system files such FS Tab, doing the mount on it and so forth and we've looked at several of those a well. These are just a few key things you'll do when you troubleshoot a startup. But understand, there are many more as well.
Tutorial Information
| Course: | Unix System Administration Essentials |
| Author: | Bobby Rogers |
| SKU: | 34153 |
| ISBN: | 1-936334-45-3 |
| Release Date: | 2010-08-12 |
| Duration: | 4.5 hrs / 57 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 