Last time at job interview I was asked about pids on Linux system.
For example, there is two pids, 12344 and 23444 which was 1st?
At 1st shot pids start from 1 for init then pid grow up, usually per 1 ;)
but nowadays Linux kernel has 'magic' option, which 'mix' pid.
They are not counted step by step ;)
There is some free spaces between pid numbers, some app start, then stop,
kernel works and thinks which pid give.
[root@mail ~]# ps -eo pid,lstart,cmd
PID STARTED CMD
1 Fri Mar 7 09:38:00 2014 init [3]
2 Fri Mar 7 09:38:00 2014 [kthreadd]
3 Fri Mar 7 09:38:00 2014 [ksoftirqd/0]
5 Fri Mar 7 09:38:00 2014 [kworker/0:0H]
------
3942 Fri Mar 7 09:41:47 2014 /usr/sbin/httpd -f /etc/httpd/apache.conf
9727 Mon Mar 10 12:49:14 2014 /sbin/mingetty --noclear tty1
10527 Fri Mar 7 11:36:32 2014 /usr/sbin/sshd
-------
17901 Wed Mar 12 12:14:45 2014 dovecot/pop3-login
17903 Wed Mar 12 12:14:58 2014 ps -eo pid,lstart,cmd
18252 Sat Mar 8 01:40:34 2014 dovecot/auth
22125 Mon Mar 10 05:02:06 2014 /usr/sbin/fcgi- -f /etc/httpd/apache.conf
Whatever ...
Brak komentarzy:
Prześlij komentarz