Журнал лабораторных работ

Содержание

Журнал

Четверг (08/01/13)

/dev/pts/0
13:57:31
#kill -18 13650

13:57:38
#jobs
[1]   Running                 sleep 5000 &
[2]   Running                 sleep 5001 &
[3]   Running                 sleep 5002 &
[4]-  Running                 sleep 5003 &
[5]+  Running                 sleep 5004 &
13:57:40
#kill -19 -p 13650
l3script: kill: -p: arguments must be process or job IDs
[1]+  Stopped                 sleep 5000
13:58:00
#jobs
[1]+  Stopped                 sleep 5000
[2]   Running                 sleep 5001 &
[3]   Running                 sleep 5002 &
[4]   Running                 sleep 5003 &
[5]-  Running                 sleep 5004 &
13:58:05
#kill -s SIGKILL 13650
[1]+  Убито              sleep 5000
13:58:36
#jobs
[2]   Running                 sleep 5001 &
[3]   Running                 sleep 5002 &
[4]-  Running                 sleep 5003 &
[5]+  Running                 sleep 5004 &
14:00:42
#kill -9 13658 13666
[2]   Убито              sleep 5001
[3]   Убито              sleep 5002
14:00:56
#ps aux|grep sleep
root     13674  0.0  0.0   4928   504 pts/3    S    14:56   0:00 sleep 5003
root     13682  0.0  0.0   4928   504 pts/3    S    14:56   0:00 sleep 5004
root     13802  0.0  0.1   5076   736 pts/3    S+   15:01   0:00 grep sleep
14:01:04
#killall -9 sleep
[4]-  Убито              sleep 5003
[5]+  Убито              sleep 5004
14:01:50
#killall -l
HUP INT QUIT ILL TRAP ABRT IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM
STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS
UNUSED
14:02:18
#pidof

14:02:53
#pidof bash
13108 13081 3081 2739 2198 2169
14:03:45
#pidof bash|tr ' ' ','^C

14:03:57
#pidof bash|tr ' ' ','
                    pgrep bash
2169
2198
2739
3081
13081
13108
14:04:11
#pgrep '^k.*d$'
2
15
16
18
20
180
370
14:04:33
#ps -p `pgrep '^k.*d$'`
  PID TTY      STAT   TIME COMMAND
    2 ?        S      0:00 [kthreadd]
   15 ?        S<     0:00 [kintegrityd]
   16 ?        S<     0:00 [kblockd]
   18 ?        S      0:00 [khungtaskd]
   20 ?        SN     0:00 [ksmd]
  180 ?        S      0:04 [kjournald]
  370 ?        S<     0:00 [kpsmoused]
14:04:41
#nice -p 19 sleep 5000
nice: неверный ключ -- p
Попробуйте `nice --help' для получения более подробного описания.
14:06:10
#nice -n 19 sleep 5000
^C
14:06:21
#nice -n 19 sleep 5000 &
[1] 13930
14:06:24
#ps alx|grep sleep
0     0 13930 10320  39  19   4928   504 -      SN   pts/3      0:00 sleep 5000
0     0 13939 10320  20   0   5076   736 -      S+   pts/3      0:00 grep sleep
14:06:39
#nice -19 sleep 5001 &
[2] 13947
14:07:06
#ps alx|grep sleep
0     0 13930 10320  39  19   4928   504 -      SN   pts/3      0:00 sleep 5000
0     0 13947 10320  39  19   4928   504 -      SN   pts/3      0:00 sleep 5001
0     0 13956 10320  20   0   5076   740 -      S+   pts/3      0:00 grep sleep
14:07:09
#nice --19 sleep 5001 &
[3] 13964
14:07:17
#nice -n -19 sleep 5001 &
[4] 13981
14:07:35
#renice +6 -p 13981
13981: old priority -19, new priority 6
14:09:01
#ps alx|grep sleep
0     0 13930 10320  39  19   4928   504 -      SN   pts/3      0:00 sleep 5000
0     0 13947 10320  39  19   4928   504 -      SN   pts/3      0:00 sleep 5001
4     0 13964 10320   1 -19   4928   504 -      S<   pts/3      0:00 sleep 5001
4     0 13981 10320  26   6   4928   504 -      SN   pts/3      0:00 sleep 5001
0     0 14007 10320  20   0   5076   740 -      S+   pts/3      0:00 grep sleep
14:09:05
#renice +6 -p 1
1: old priority 0, new priority 6
14:09:14
#ps alx|grep init
4     0     1     0  26   6   2084   696 -      SNs  ?          0:04 init [2]
0     0 14024 10320  20   0   5080   736 -      S+   pts/3      0:00 grep init
14:09:26
#renice 19 -p 1
1: old priority 6, new priority 19
14:09:33
#ps alx|grep init
4     0     1     0  39  19   2084   696 -      SNs  ?          0:04 init [2]
0     0 14041 10320  20   0   5080   736 -      S+   pts/3      0:00 grep init
14:09:38
#renice 0 -p 1
1: old priority 19, new priority 0
14:09:52
#renice 19 -u user
1000: old priority 0, new priority 19
14:10:00
#ps alx|grep user
4  1000 13107 13081  39  19   5700  1140 -      SN   pts/5      0:00 su user -
0     0 14066 10320  20   0   5076   736 -      S+   pts/3      0:00 grep user
14:10:17
#top -p $(echo `ps t pts/5|awk '{ print $1; };'|grep -v PID`|tr ' ' ',')
top - 15:10:34 up 3 days,  6:17,  3 users,  load average: 0.10, 0.10, 0.14
Tasks:   3 total,   0 running,   3 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.0%sy,  0.2%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    513668k total,   506432k used,     7236k free,   184460k buffers
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
Swap:        0k total,        0k used,        0k free,   209584k cached
13081 root      20   0  7420 2988 1496 S  0.0  0.6   0:00.17 bash
13107 user      39  19  5700 1140  928 S  0.0  0.2   0:00.00 su
13108 user      39  19  9840 5220 1496 S  0.0  1.0   0:00.35 bash
14:10:36
#nice --19 sleep 5600 &
[5] 14097
прошло 62 минуты
15:12:43
#kill -9 14097
[5]+  Убито              nice --19 sleep 5600
15:13:06
#vim /etc/rc.local
прошло 11 минут
15:24:32
#~
 57 4:23:respawn:/sbin/getty 38400 tty4
 58 5:23:respawn:/sbin/getty 38400 tty5
 60
 61 # Example how to put a getty on a serial line (for a terminal)
 62 #
 63 #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
 64 #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
 65
 66 # Example how to put a getty on a modem line.
 67 #
 68 #T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
 59 6:23:respawn:/sbin/getty 38400 tty6                       68,35         97%
15:28:12
# 3
K01anacron  K01openbsd-inetd  K03rsyslog       K06hwclock.sh  K09umountroot
K01atd      K01squid3         K04umountnfs.sh  K06networking  K10halt
K01exim4    K01urandom        K05nfs-common    K07ifupdown    README
K01netdiag  K02sendsigs       K05portmap       K08umountfs
15:28:21
#ssh root@192.168.13.3
The authenticity of host '192.168.13.3 (192.168.13.3)' can't be established.
RSA key fingerprint is 62:dd:81:b1:0d:50:38:41:e7:82:ea:89:d5:48:16:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.13.3' (RSA) to the list of known hosts.
root@192.168.13.3's password:
Linux debian3 2.6.39-bpo.2-686-pae #1 SMP Thu Aug 4 11:02:22 UTC 2011 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Aug  1 16:30:03 2013
l3-agent is already running: pid=2987; pidfile=/root/.lilalo/l3-agent.pid
root@debian3:~# init 1
root@debian3:~# Connection to 192.168.13.3 closed by remote host.
Connection to 192.168.13.3 closed.
[1]   Done                    nice -n 19 sleep 5000
15:30:20
#ssh root@192.168.13.3
ssh: connect to host 192.168.13.3 port 22: Connection refused
[2]   Done                    nice -19 sleep 5001
[3]-  Done                    nice --19 sleep 5001
15:30:43
#who
root     pts/0        2013-07-30 11:30 (192.168.15.105:S.0)
root     pts/5        2013-08-01 14:28 (192.168.15.105)
[4]+  Done                    nice -n -19 sleep 5001
15:30:58
#ping 192.168.13.3
PING 192.168.13.3 (192.168.13.3) 56(84) bytes of data.
64 bytes from 192.168.13.3: icmp_req=1 ttl=64 time=0.275 ms
64 bytes from 192.168.13.3: icmp_req=2 ttl=64 time=0.296 ms
^C
--- 192.168.13.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.275/0.285/0.296/0.019 ms
15:31:23
#ssh root@192.168.13.3
ssh: connect to host 192.168.13.3 port