Download
process management n.
Skip this Video
Loading SlideShow in 5 Seconds..
Process Management PowerPoint Presentation
Download Presentation
Process Management

Process Management

87 Vues Download Presentation
Télécharger la présentation

Process Management

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Process Management

  2. Assignment Issues • Command line parameters • References

  3. What is a process? • An application that does something • ls or the start button, etc

  4. Types of OS’s • Single tasking • Batch • Multiprogramming • Multitasking • Multithreaded Linux is Multi-tasking and Multi-threaded

  5. Monitoring process in Linux • ps – snapshot of running processes • top – interactive ps, updates periodically • “System Monitor” – GUI version of top

  6. Background processes • Two ways to create • Command followed by & • df –k & • Ctrl-Z in an interactive command

  7. Terminating processes • Three ways: • Ctrl-C – only works on foreground CLI processes • Kill command – kill -15 1234 • kill <signal> <pid> • 15 – means “please go away” • 9 – “go away now” • Others – depends on application • killall – only root can run, also linux specific

  8. Process Scheduling

  9. When do processes run? • Kernel Daemons/Background (&ed commands) • Scheduled by the kernel • Now • Commands in the CLI • Clicks in the GUI • Later • at • batch • cron

  10. at • One time scheduling • Basic Syntax: • at –f <command> <time> • Command has to be a shell script, don’t forget to add the execute bit! • /etc/at.allow – users allowed to use at • No at.allow means all users • /etc/at.deny – users not allowed to use at

  11. batch • Sort of like at, but not time based, runs on load

  12. Other at commands • atq – shows what’s in your at queue • atrm – allows you to remove queued at jobs

  13. cron • Schedules jobs at specific times and dates • /etc/cron.allow – users allowed to use cron • No cron.allow means all users • /etc/cron.deny – users not allowed to use cron • 2 ways to schedule • Files in /var/spool/cron (called crontabs) • /etc/cron.*

  14. crontabs • Edit them via crontab –e • 1 job per line: 10 3 * * * /usr/sbin/logadm • * does not mean 1, it means ALL

  15. Crontab time fields • field allowed values • ----- -------------- • minute 0-59 • hour 0-23 • day of month 1-31 • Month 1-12 • day of week 0-7

  16. /etc/cron.* • Directories in /etc • /etc/cron.hourly • /etc/cron.daily • /etc/cron.weekly • /etc/cron.monthly • Copy script into appropriate directory • Want something daily and hourly, must be in both

  17. Cron gotchas! • at/batch inherit your current shell environment, cron DOES not • Don’t forget to chmod +x your scripts • Don’t hand edit the crontab files, always use crontab –e • By default, all three send email to user who scheduled