Upload
albert-marcon
View
266
Download
3
Embed Size (px)
Citation preview
1. Linux boot loader
2. Linux boot process
3. Linux processes
4. Linux services
5. Linux top
6. Remember proc ?
7. Linux Device Management
8. Linux Massages log
9. Schedule tasks with cron
Process Management
• the init process and the boot flow• Linux run levels• /etc/init.d• the init command• changing default run level /etc/inittab• Booting into single mode from the boot-loader
menu
Linux boot process
• Find a process with ps
# ps aux
# ps –ef
• Kill a process with kill
# kill -15 PID
# kill -9 PID
Linux processes
• /var/log/massages is the main kernel log
Jul 7 14:20:59 NX102 kernel: iscsi: registered transport (be2iscsi)
Jul 7 14:20:59 NX102 kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Jul 7 14:20:59 NX102 kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jul 7 14:20:59 NX102 kernel: e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control
Jul 7 14:20:59 NX102 kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jul 7 14:20:59 NX102 kernel: scsi1 : iSCSI Initiator over TCP/IP
Linux Massages log
1. Go to run level 3
2. Find your current run level
3. set your default init to 3
4. reboot and enter single mode, then change the run level back to 5.
5. Open a firefox browser, find the browser PID and kill it gently.
6. find all the services set to run in run level 5
7. set the cups server to start at all relevant levels
8. set the linux firewall not to start at all run levels
Exercise
9. create a new title in the boot loader and call it Linux-Your-Name
10. Set this to be the default title.
11. Set the boot loader count down to 10 seconds
12. Add a new Virtual Hard Drive (1GB) to the VirtualBox Linux guest.
13. Reboot and check with dmesg to locate this new disk.
14.Create a cron job that will run every day at 12:30 past midnight (AM) and will look for files with 777 perm and save a list of the files under /tmp
Exercise
Exercise
15. Create a list of all linux usb and pci devices.
16. issue the lsmod mode and examine the output, do you see the Bluetooth driver loaded ?
17. what is this file ?
# /etc/sysconfig/hwconf
18. Can you manually run kudzu ?
19. How many processes are currently running ?
20. Open 6 firefox browsers. can you kill them all In one single command ?
21. How can you count the linux cpu cores in one command ?