1 / 15

Les 5 – Processes

Les 5 – Processes. Processes inside out. Multi−user and multi−tasking Linux is based on UNIX, where it has been common policy to have multiple users running multiple commands, at the same time and on the same system. Daemons.

zuwena
Download Presentation

Les 5 – Processes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Les 5 – Processes

  2. Processes inside out Multi−user and multi−tasking Linux is based on UNIX, where it has been common policy to have multiple users running multiple commands, at the same time and on the same system

  3. Daemons Daemons are server processes that run continuously. Most of the time, they are initialized at system startup and then wait in the background until their service is required. A typical example is the networking daemon, xinetd, which is started in almost every boot procedure. After the system is booted, the network daemon just sits and waits until a client program, such as an FTP client, needs to connect

  4. Job control regular_command - Runs this command in the foreground. command & - Run this command in the background (release the terminal) jobs - Show commands running in the background. CTRL+Z - Suspend (stop, but not quit) a process running in the foreground (suspend). CTRL+C - Interrupt (terminate and quit) a process running in the foreground. %n - Every process running in the background gets a number assigned to it. By using kill - End a process (also see Shell Builtin Commands in the Info pages of bash)

  5. Display job information Ps Top Ps –axjf (for tree mode)

  6. Boot proces BIOS (POST) MBR Grub/Lilo Init (father of all processes) • spawns all other processes. • It runs as a daemon and typically has PID 1. /etc/inittab (sets the runlevels)

  7. Runlevels # 0 − halt (Do NOT set initdefault to this) # 1 − Single user mode # 2 − Multiuser, without NFS (The same as 3, if you do not have networking) # 3 − Full multiuser mode # 4 − unused # 5 − X11 # 6 − reboot (Do NOT set initdefault to this)

  8. Shutdown / reboot Shutdown -h now (immediately) or halt Shutdown -r now (reboot) Reboot Init <runlevel>

  9. Priority Nice (-20 (best) to 19 (least)) Renice (same as nice, but for running procs )

  10. Scheduling processes Use idle time ! Sleep At (The at command executes commands at a given time) Crontab (easy scheduling)

  11. Cron and crontab The cron system is managed by the cron daemon. It gets information about which programs and when they should run from the system's and users' crontab entries. Only the root user has access to the system crontabs While each user should only have access to his own crontabs. On some systems (some) users may not have access to the cron facility.

  12. /etc/crontab root@TBE1ID980168:~# cat /etc/crontab # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

  13. Crontab usage Crontab -l Crontab -e Kill -HUP <cron-pid> (deprecated)

  14. Summary (1)

  15. Summary (2)

More Related