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

Содержание

Журнал

Понедельник (10/22/12)

/dev/tty1
13:43:53
#l3-agent
l3-agent is already running: pid=7136; pidfile=/root/.lilalo/l3-agent.pid
13:45:55
#w
 07:46:55 up  1:04,  5 users,  load average: 0.01, 0.07, 0.13
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
user     tty1                      07:40    0.00s  0.45s  0.17s -bash
root     tty2                      23:52    1:39   2.59s  2.38s ssh user@192.168.15.254
user     tty7     :0               00:16    8:04m  4.14s  0.06s x-session-manager
user     pts/0    :0.0             00:17    9:23   0.45s  1.27s gnome-terminal
user     pts/1    :0.0             07:29   16:52   0.16s  0.16s bash
13:46:55
#apt-get install asterisk
Package configuration
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────┤ Configuring libvpb0 ├─────────────────â”
  │ This is the numeric code for the region your phone system will be operating in (eg. 61 for Australia or 33 for France).  It is used to configure the default regional standards that Voicetronix telephony hardware should comply with.  │
  │                                                                                                                                                                                                                                          │
  │ ITU-T telephone code:                                                                                                                                                                                                                    │
  │                                                                                                                                                                                                                                          │
  â”3861______________________________________________________________________________________________________________________________________________________________________________________________________________________________________ │
  │                                                                                                                                                                                                                                          │
  │                                                                                                                <Ok>k>                                                                                                                    │
  │                                                                                                                                                                                                                                          │
...
Setting up unixodbc (2.2.14p2-1) ...
Setting up asterisk (1:1.6.2.9-2+squeeze6) ...
Adding system user for Asterisk
Adding user `asterisk' to group `dialout' ...
Adding user asterisk to group dialout
Done.
Adding user `asterisk' to group `audio' ...
Adding user asterisk to group audio
Done.
Starting Asterisk PBX: asterisk.
прошло 43 минуты
14:30:37
#apt-cache seacrh asterisk
E: Invalid operation seacrh
14:31:42
#apt-cache search asterisk
asterisk-mobile - bluetooth mobile devices support for Asterisk
asterisk-mp3 - MP3 format support (format_mp3) for the Asterisk PBX
asterisk-mysql - MySQL support for the Asterisk PBX (cdr mainly)
asterisk-ooh323c - H.323 protocol support for Asterisk (ooh323c stack)
asterisk-chan-capi - Common ISDN API 2.0 implementation for Asterisk
asterisk-core-sounds-en-g722 - asterisk PBX sound files - English/g722
asterisk-core-sounds-en-gsm - asterisk PBX sound files - English/gsm
asterisk-core-sounds-en-wav - asterisk PBX sound files - English/wav
asterisk-core-sounds-es-g722 - asterisk PBX sound files - Spanish/g722
asterisk-core-sounds-es-gsm - asterisk PBX sound files - Spanish/gsm
...
asterisk - Open Source Private Branch Exchange (PBX)
dahdi-linux - DAHDI telephony interface - Linux userspace parts
dahdi-source - DAHDI telephony interface - source code for kernel driver
dahdi - utilities for using the DAHDI kernel modules
iaxmodem - software modem with IAX2 connectivity
libasterisk-agi-perl - Collections of Perl modules to be used with Asterisk PBX AGI
libnetsds-perl - Service Delivery Suite framework
op-panel - switchboard type application for the Asterisk PBX
libopenr2-3 - MFC/R2 (telephony) call setup library
python-asterisk - Asterisk Manager API interface module for Python
14:34:21
#apt-get install asterisk-sounds-main asterisk-sounds-extra
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  asterisk-core-sounds-en-gsm
The following NEW packages will be installed:
  asterisk-sounds-extra asterisk-sounds-main
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
Need to get 5,607 kB of archives.
After this operation, 7,000 kB of additional disk space will be used.
...
Selecting previously deselected package asterisk-sounds-main.
(Reading database ... 107561 files and directories currently installed.)
Unpacking asterisk-sounds-main (from .../asterisk-sounds-main_1%3a1.6.2.9-2+squeeze6_all.deb) ...
Setting up asterisk-sounds-main (1:1.6.2.9-2+squeeze6) ...
update-alternatives: using /usr/share/asterisk/sounds/en_US_f_Allison to provide /usr/share/asterisk/sounds/en (asterisk-prompt-en) in auto mode.
update-alternatives: using /usr/share/asterisk/sounds/en_US_f_Allison to provide /usr/share/asterisk/sounds/en_US (asterisk-prompt-en-us) in auto mode.
Selecting previously deselected package asterisk-sounds-extra.
(Reading database ... 108031 files and directories currently installed.)
Unpacking asterisk-sounds-extra (from .../asterisk-sounds-extra_1.4.9-1_all.deb) ...
Setting up asterisk-sounds-extra (1.4.9-1) ...
14:34:46
#dpkg -L asterisk-sounds-main
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/asterisk-sounds-main
/usr/share/doc/asterisk-sounds-main/NEWS.Debian.gz
/usr/share/doc/asterisk-sounds-main/changelog.Debian.gz
/usr/share/doc/asterisk-sounds-main/changelog.gz
/usr/share/doc/asterisk-sounds-main/copyright
/usr/share/asterisk
...
/usr/share/asterisk/sounds/en_US_f_Allison/phonetic/o_p.gsm
/usr/share/asterisk/sounds/en_US_f_Allison/pbx-transfer.gsm
/usr/share/asterisk/sounds/en_US_f_Allison/vm-from-phonenumber.gsm
/usr/share/asterisk/sounds/en_US_f_Allison/queue-holdtime.gsm
/usr/share/asterisk/sounds/en_US_f_Allison/vm-toforward.gsm
/usr/share/asterisk/sounds/en_US_f_Allison/conf-otherinparty.gsm
/usr/share/asterisk/sounds/.asterisk-core-sounds-en-gsm-1.4.19
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/asterisk-sounds-main
14:44:01
#ls -l /var/tmp
total 0
14:44:06
#ls -l /var
total 48
drwxr-xr-x  2 root root  4096 Oct 22 07:38 backups
drwxr-xr-x 15 root root  4096 Oct 22 08:30 cache
drwxr-xr-x  2 root root  4096 Oct 21 23:59 games
drwxr-xr-x 48 root root  4096 Oct 22 08:30 lib
drwxrwsr-x  2 root staff 4096 Jun 19  2011 local
drwxrwxrwt  2 root root  4096 Oct 22 07:38 lock
drwxr-xr-x 11 root root  4096 Oct 22 08:30 log
drwxrwsr-x  2 root mail  4096 Oct 21 22:19 mail
drwxr-xr-x  2 root root  4096 Oct 21 22:19 opt
drwxr-xr-x 11 root root  4096 Oct 22 08:30 run
drwxr-xr-x  5 root root  4096 Oct 22 08:30 spool
drwxrwxrwt  2 root root  4096 Oct 22 08:30 tmp
14:44:18
#date
Mon Oct 22 08:44:56 EDT 2012
14:44:56
#ntpdate 193.193.193.100
22 Oct 08:45:09 ntpdate[10221]: the NTP socket is in use, exiting
14:45:09
#lsof
COMMAND     PID       USER   FD      TYPE     DEVICE SIZE/OFF       NODE NAME
init          1       root  cwd       DIR        8,2     4096          2 /
init          1       root  rtd       DIR        8,2     4096          2 /
init          1       root  txt       REG        8,2    31676    2754963 /sbin/init
init          1       root  mem       REG        8,2     9736     131075 /lib/i686/cmov/libdl-2.11.3.so
init          1       root  mem       REG        8,2  1327556     131094 /lib/i686/cmov/libc-2.11.3.so
init          1       root  mem       REG        8,2   104276     131158 /lib/libselinux.so.1
init          1       root  mem       REG        8,2   215520     131156 /lib/libsepol.so.1
init          1       root  mem       REG        8,2   118060     134905 /lib/ld-2.11.3.so
init          1       root   10u     FIFO        0,5      0t0       3489 /dev/initctl
...
gnome-scr 30293       user  mem       REG        8,2    30540    2629838 /usr/lib/libstartup-notification-1.so.0.0.0
gnome-scr 30293       user  mem       REG        8,2   637480    2627387 /usr/lib/libgio-2.0.so.0.2400.2
gnome-scr 30293       user  mem       REG        8,2   478684    2627409 /usr/lib/libcairo.so.2.10800.10
gnome-scr 30293       user  mem       REG        8,2   149392     131076 /lib/i686/cmov/libm-2.11.3.so
gnome-scr 30293       user  mem       REG        8,2    98300    2629656 /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1
gnome-scr 30293       user  mem       REG        8,2    10308    2627390 /usr/lib/libgmodule-2.0.so.0.2400.2
gnome-scr 30293       user  mem       REG        8,2   341044    2627475 /usr/lib/libORBit-2.so.0.1.0
gnome-scr 30293       user  mem       REG        8,2    30684     131093 /lib/i686/cmov/librt-2.11.3.so
gnome-scr 30293       user  mem       REG        8,2    14388    2627388 /usr/lib/libgthread-2.0.so.0.2400.2
gnome-scr 30293       user  mem       REG        8,2  1327556     131094 /lib/i686/cmov/libc-2.11.3.so
14:45:23
#lsof | grep ntp
ntpd      30784        ntp  cwd       DIR        8,2     4096          2 /
ntpd      30784        ntp  rtd       DIR        8,2     4096          2 /
ntpd      30784        ntp  txt       REG        8,2   454916    2644491 /usr/sbin/ntpd
ntpd      30784        ntp  mem       REG        8,2    38504     131074 /lib/i686/cmov/libnss_nis-2.11.3.so
ntpd      30784        ntp  mem       REG        8,2    79676     131078 /lib/i686/cmov/libnsl-2.11.3.so
ntpd      30784        ntp  mem       REG        8,2    30496     131097 /lib/i686/cmov/libnss_compat-2.11.3.so
ntpd      30784        ntp  mem       REG        8,2    71432     131080 /lib/i686/cmov/libresolv-2.11.3.so
ntpd      30784        ntp  mem       REG        8,2    42580     131081 /lib/i686/cmov/libnss_files-2.11.3.so
ntpd      30784        ntp  mem       REG        8,2    14888     131117 /lib/libattr.so.1.1.0
ntpd      30784        ntp  mem       REG        8,2   117367     131084 /lib/i686/cmov/libpthread-2.11.3.so
...
ntpd      30784        ntp    1u      CHR        1,3      0t0       1042 /dev/null
ntpd      30784        ntp    2u      CHR        1,3      0t0       1042 /dev/null
ntpd      30784        ntp    3u     unix 0xf7323700      0t0      38959 socket
ntpd      30784        ntp    5w     FIFO        0,8      0t0      38436 pipe
ntpd      30784        ntp   16u     IPv4      38181      0t0        UDP *:ntp
ntpd      30784        ntp   17u     IPv6      38182      0t0        UDP *:ntp
ntpd      30784        ntp   18u     IPv4      38188      0t0        UDP localhost:ntp
ntpd      30784        ntp   19u     IPv4      38189      0t0        UDP linux10.unix.ais:ntp
ntpd      30784        ntp   20u     IPv6      38190      0t0        UDP [fe80::20f:feff:fe7e:b94f]:ntp
ntpd      30784        ntp   21u     IPv6      38191      0t0        UDP ip6-localhost:ntp
14:52:49
#ls /usr/sbin/s
safe_asterisk            saned                    select-default-wordlist  service                  setvesablank             sshd                     synaptic
safe_finger              select-default-ispell    sensors-detect           sethdlc                  smsq                     su-to-root               system-tools-backends
14:52:49
#man asterisk
14:53:31
#/etc/init.d/saned .
./             ../            .aptitude/     .bash_history  .bash_profile  .bashrc        .l3rc          .lilalo/       .mc/           .profile       .ssh/
14:53:31
#/etc/init.d/saned .
./             ../            .aptitude/     .bash_history  .bash_profile  .bashrc        .l3rc          .lilalo/       .mc/           .profile       .ssh/
14:53:31
#/etc/init.d/a
acpid         alsa-utils    anacron       asterisk      avahi-daemon
14:53:31
#cat /etc/init.d/asterisk
#!/bin/sh
#
# asterisk      start the asterisk PBX
# (c) Mark Purcell <msp@debian.org>
# (c) Tzafrir Cohen <tzafrir.cohen@xorcom.com>
# (c) Faidon Liambotis <paravoid@debian.org>
#
#   This package is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
...
        status
        exit $?
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload}" >&2
        exit 1
        ;;
esac
exit 0
14:54:23
#cat /etc/init.d/asterisk |less
14:54:39
#/etc/init.d/asterisk status
Asterisk PBX is running.
14:54:47
#cat `/var/run/astarisk.pid`
l3script: /var/run/astarisk.pid: No such file or directory
^[[A^C
14:55:26
#cat `/var/run/astarisk`
l3script: /var/run/astarisk: No such file or directory
^C
14:55:33
#ls /var/run/
acpid.pid               avahi-daemon/           console-kit-daemon.pid  dbus/                   motd                    pm-utils/               sdp                     utmp
acpid.socket            console/                crond.pid               gdm3/                   NetworkManager.pid      rsyslogd.pid            sshd/
asterisk/               ConsoleKit/             crond.reboot            gdm3.pid                ntpd.pid                screen/                 sshd.pid
14:55:33
#ls /var/run/asterisk/
alt.asterisk.canary.tweet.tweet.tweet  asterisk.ctl  asterisk.pid
14:56:08
#cat `/var/run/asterisk/asterisk.pid`
l3script: /var/run/asterisk/asterisk.pid: Permission denied
^C
14:56:27
#ps aux |grep [a]sterisk
asterisk 10014  0.0  0.2  47656 18268 ?        Ssl  08:30   0:00 /usr/sbin/asterisk -p -U asterisk
asterisk 10015  0.0  0.0   2940   572 ?        S    08:30   0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 10014
15:01:57
#/etc/init.d/asterisk status
Asterisk PBX is running.
15:02:12
#ls -l /etc/rc2.d/*asterisk
lrwxrwxrwx 1 root root 18 Oct 22 08:30 /etc/rc2.d/S03asterisk -> ../init.d/asterisk
15:05:42
#runlevel
N 2
15:06:12
#ls -l /proc/4335/fd
ls: cannot access /proc/4335/fd: No such file or directory
15:08:37
#ls -l /proc/4335/fd/
ls: cannot access /proc/4335/fd/: No such file or directory
15:08:42
#ls -l /proc/10014/fd/
ls: cannot access /proc/10014/fd/: No such file or directory
15:09:08
#netstat -lp | grep 10427
tcp        0      0 localhost:5038          *:*                     LISTEN      10427/asterisk
tcp        0      0 *:cisco-sccp            *:*                     LISTEN      10427/asterisk
udp        0      0 *:5000                  *:*                                 10427/asterisk
udp        0      0 *:4520                  *:*                                 10427/asterisk
udp        0      0 *:sip                   *:*                                 10427/asterisk
udp        0      0 *:iax                   *:*                                 10427/asterisk
udp        0      0 *:2727                  *:*                                 10427/asterisk
unix  2      [ ACC ]     STREAM     LISTENING     57360    10427/asterisk      /var/run/asterisk/asterisk.ctl
15:09:52
#netstat -lpn | grep 10427
tcp        0      0 127.0.0.1:5038          0.0.0.0:*               LISTEN      10427/asterisk
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN      10427/asterisk
udp        0      0 0.0.0.0:5000            0.0.0.0:*                           10427/asterisk
udp        0      0 0.0.0.0:4520            0.0.0.0:*                           10427/asterisk
udp        0      0 0.0.0.0:5060            0.0.0.0:*                           10427/asterisk
udp        0      0 0.0.0.0:4569            0.0.0.0:*                           10427/asterisk
udp        0      0 0.0.0.0:2727            0.0.0.0:*                           10427/asterisk
unix  2      [ ACC ]     STREAM     LISTENING     57360    10427/asterisk      /var/run/asterisk/asterisk.ctl
15:10:58
#asterisk -r
Asterisk 1.6.2.9-2+squeeze6, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze6 currently running on unix (pid = 10427)
unix*CLI> core show sysinfo
System Statistics
...
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
unix*CLI> core show uptime
System uptime: 11 minutes, 20 seconds
Last reload: 11 minutes, 20 seconds
unix*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline]
unix*CLI> exit
15:15:53
#asterisk -rvvv
Asterisk 1.6.2.9-2+squeeze6, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze6 currently running on unix (pid = 10427)
...
No such command 'grep -v '^;' /etc/asterisk/sip.conf' (type 'core show help grep -v' for other possible commands)
unix*CLI> grep -v '^;' /etc/asterisk/sip.conf
No such command 'grep -v '^;' /etc/asterisk/sip.conf' (type 'core show help grep -v' for other possible commands)
unix*CLI> expand /etc/asterisk/sip.conf | grep -v '^ *;' | grep -xv '' |less
No such command 'expand /etc/asterisk/sip.conf | grep -v '^ *;' | grep -xv '' |less' (type 'core show help expand /etc/asterisk/sip.conf' for other possible commands)
unix*CLI> apt-get install grep
No such command 'apt-get install grep' (type 'core show help apt-get install' for other possible commands)
unix*CLI> apt-get install grep
Disconnected from Asterisk server
Executing last minute cleanups
прошло 15 минут
/dev/tty3
15:31:37
#ls -l
total 660
-rw-r----- 1 asterisk asterisk   140 Jun  5 05:30 adsi.conf
-rw-r----- 1 asterisk asterisk   840 Jun  5 05:30 adtranvofr.conf
-rw-r----- 1 asterisk asterisk  3035 Jun  5 05:30 agents.conf
-rw-r----- 1 asterisk asterisk  2906 Jun  5 05:30 ais.conf
-rw-r----- 1 asterisk asterisk  2227 Jun  5 05:30 alarmreceiver.conf
-rw-r----- 1 asterisk asterisk  3259 Jun  5 05:30 alsa.conf
-rw-r----- 1 asterisk asterisk   767 Jun  5 05:30 amd.conf
-rw-r----- 1 asterisk asterisk  3260 Jun  5 05:30 asterisk.adsi
-rw-r----- 1 asterisk asterisk  3234 Jun  5 05:30 asterisk.conf
...
-rw-r----- 1 asterisk asterisk  9135 Jun  5 05:30 skinny.conf
-rw-r----- 1 asterisk asterisk  6717 Jun  5 05:30 sla.conf
-rw-r----- 1 asterisk asterisk  2669 Jun  5 05:30 smdi.conf
-rw-r----- 1 asterisk asterisk  1384 Jun  5 05:30 telcordia-1.adsi
-rw-r----- 1 asterisk asterisk   656 Jun  5 05:30 udptl.conf
-rw-r----- 1 asterisk asterisk  4909 Jun  5 05:30 unistim.conf
-rw-r----- 1 asterisk asterisk  3216 Jun  5 05:30 usbradio.conf
-rw-r----- 1 asterisk asterisk  2011 Jun  5 05:30 users.conf
-rw-r----- 1 asterisk asterisk 17961 Jun  5 05:30 voicemail.conf
-rw-r----- 1 asterisk asterisk  5939 Jun  5 05:30 vpb.conf
15:31:39
#mv sip
sip.conf.BACKUP  sip_notify.conf
15:31:39
#mv sip
sip.conf.BACKUP  sip_notify.conf
15:31:39
#mv sip.conf.BACKUP sip.conf

15:32:42
#expand sip.conf | grep -v '^ *;' | grep -xv '' | less
15:33:31
#expand sip.conf.BACKUP | grep -v '^ *;' | grep -xv '' | less
15:34:23
#expand sip.conf.BACKUP | grep -v '^ *;' | grep -xv '' | less > sip.conf
15:34:31
#cat sip.conf
\[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
[basic-options](!)                ; a template
        dtmfmode=rfc2833
...
[my-codecs](!)                    ; a template for my preferred codecs
        disallow=all
        allow=ilbc
        allow=g729
        allow=gsm
        allow=g723
        allow=ulaw
[ulaw-phone](!)                   ; and another one for ulaw-only
        disallow=all
        allow=ulaw
15:34:35
#cat sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
[basic-options](!)                ; a template
        dtmfmode=rfc2833
...
[my-codecs](!)                    ; a template for my preferred codecs
        disallow=all
        allow=ilbc
        allow=g729
        allow=gsm
        allow=g723
        allow=ulaw
[ulaw-phone](!)                   ; and another one for ulaw-only
        disallow=all
        allow=ulaw
15:34:38
#vi sip.conf
15:35:27
# allow=ula

15:37:23
#[general]
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[authentication]
;[basic-options](!)                ; a template
;        dtmfmode=rfc2833
...
;        allow=gsm
;        allow=g723
;        allow=ulaw
;[ulaw-phone](!)                   ; and another one for ulaw-only
;        disallow=all
;        allow=ulaw
[1301]
type=friend
secret=1234
host=dynamic
15:37:31
#asterisk -r
Asterisk 1.6.2.9-2+squeeze6, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze6 currently running on unix (pid = 10427)
Verbosity is at least 3
unix*CLI> sip show peers
...
 Reloading SIP
  == Parsing '/etc/asterisk/sip.conf':   == Found
  == Parsing '/etc/asterisk/users.conf':   == Found
  == Parsing '/etc/asterisk/sip_notify.conf':   == Found
unix*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
1301                       (Unspecified)    D   N      5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
unix*CLI>
Disconnected from Asterisk server
прошло 23 минуты
16:00:37
#ping 192.168.1.253
PING 192.168.1.253 (192.168.1.253) 56(84) bytes of data.
From 10.0.64.155 icmp_seq=2 Destination Host Unreachable
From 10.0.64.155 icmp_seq=3 Destination Host Unreachable
From 10.0.64.155 icmp_seq=4 Destination Host Unreachable
^C
--- 192.168.1.253 ping statistics ---
7 packets transmitted, 0 received, +3 errors, 100% packet loss, time 6017ms
pipe 3
16:00:53
#ping 192.168.15.253
PING 192.168.15.253 (192.168.15.253) 56(84) bytes of data.
64 bytes from 192.168.15.253: icmp_req=1 ttl=64 time=3.22 ms
64 bytes from 192.168.15.253: icmp_req=2 ttl=64 time=0.775 ms
64 bytes from 192.168.15.253: icmp_req=3 ttl=64 time=0.791 ms
64 bytes from 192.168.15.253: icmp_req=4 ttl=64 time=0.790 ms
64 bytes from 192.168.15.253: icmp_req=5 ttl=64 time=0.776 ms
64 bytes from 192.168.15.253: icmp_req=6 ttl=64 time=0.783 ms
64 bytes from 192.168.15.253: icmp_req=7 ttl=64 time=0.784 ms
64 bytes from 192.168.15.253: icmp_req=8 ttl=64 time=0.792 ms
64 bytes from 192.168.15.253: icmp_req=9 ttl=64 time=0.911 ms
64 bytes from 192.168.15.253: icmp_req=10 ttl=64 time=0.793 ms
64 bytes from 192.168.15.253: icmp_req=11 ttl=64 time=0.786 ms
64 bytes from 192.168.15.253: icmp_req=12 ttl=64 time=0.801 ms
^C
--- 192.168.15.253 ping statistics ---
12 packets transmitted, 12 received, 0% packet loss, time 11001ms
rtt min/avg/max/mdev = 0.775/1.000/3.228/0.673 ms
16:01:08
#ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.10/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20f:feff:fe7e:b94f/64 scope link
       valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 16:8c:99:fe:78:76 brd ff:ff:ff:ff:ff:ff
16:03:03
#!-1
ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.10/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20f:feff:fe7e:b94f/64 scope link
       valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 16:8c:99:fe:78:76 brd ff:ff:ff:ff:ff:ff
прошло 11 минут
16:15:00
#!-3
ping 192.168.15.253
PING 192.168.15.253 (192.168.15.253) 56(84) bytes of data.
64 bytes from 192.168.15.253: icmp_req=1 ttl=64 time=2.81 ms
64 bytes from 192.168.15.253: icmp_req=2 ttl=64 time=0.792 ms
64 bytes from 192.168.15.253: icmp_req=3 ttl=64 time=0.789 ms
64 bytes from 192.168.15.253: icmp_req=4 ttl=64 time=0.802 ms
^C
--- 192.168.15.253 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.789/1.299/2.815/0.875 ms
прошло 12 минут
16:27:41
#grep -r 192.168.15.10 /etc
grep: /etc/nologin: No such file or directory
/etc/network/interfaces:        address 192.168.15.10
16:27:49
#grep -rl 192.168.15.10 /etc
grep: /etc/nologin: No such file or directory
/etc/network/interfaces
16:28:38
#sed -i s/192.168.15.10/192.168.100.1 $(!!)
sed -i s/192.168.15.10/192.168.100.1 $(grep -rl 192.168.15.10 /etc)
grep: /etc/nologin: No such file or directory
sed: -e expression #1, char 29: unterminated `s' command
16:30:53
#sed -i s/192.168.15.10/192.168.100.1/g $(grep -rl 192.168.15.10 /etc)
grep: /etc/nologin: No such file or directory
16:31:58
#grep -rl 192.168.10.1 /etc
grep: /etc/nologin: No such file or directory
16:32:07
#grep -rl 192.168.10.1 /etc
grep: /etc/nologin: No such file or directory
16:32:13
#grep -rl 192.168.100.1 /etc
grep: /etc/nologin: No such file or directory
/etc/network/interfaces
16:32:33
#nano /etc/resolv.conf
16:33:10
#cat /etc/host
host.conf    hostname     hosts        hosts.allow  hosts.deny
16:33:10
#cat /etc/hosts
127.0.0.1       localhost
192.168.1.10    unix.nt10       unix
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
16:33:25
#nano /etc/hosts
--- /tmp/l3-saved-10912.20952.25433	2012-10-22 10:36:51.615478004 -0400
+++ /etc/hosts	2012-10-22 10:37:05.475890682 -0400
@@ -1,5 +1,5 @@
 127.0.0.1	localhost
-192.168.1.10	unix.nt10	unix
+192.168.100.1	unix.nt10	unix
 
 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
16:37:06
#127.0.0.1 localhost
127.0.0.1       localhost
192.168.100.1   unix.nt10       unix
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
16:37:10
#ifdown eth0

16:39:52
#ifup eth0
SIOCADDRT: No such process
Failed to bring up eth0.
16:39:57
#ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20f:feff:fe7e:b94f/64 scope link
       valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 16:8c:99:fe:78:76 brd ff:ff:ff:ff:ff:ff
16:40:09
#ping 192.168.90.1
connect: Network is unreachable
16:41:52
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
16:43:21
#nano /etc/network/interfaces
--- /tmp/l3-saved-10912.27190.13795	2012-10-22 10:43:59.384245917 -0400
+++ /etc/network/interfaces	2012-10-22 10:44:22.532938178 -0400
@@ -10,9 +10,9 @@
 iface eth0 inet static
 	address 192.168.100.1
 	netmask 255.255.255.0
-	network 192.168.15.0
+	network 192.168.100.0
 	broadcast 192.168.1.255
-	gateway 192.168.15.254
+	gateway 192.168.100.254
 	# dns-* options are implemented by the resolvconf package, if installed
-	dns-nameservers 192.168.1.254
+	dns-nameservers 192.168.100.254
 	dns-search nt10
16:44:58
#nano /etc/network/interfaces
--- /tmp/l3-saved-10912.29903.28004	2012-10-22 10:45:05.806233600 -0400
+++ /etc/network/interfaces	2012-10-22 10:45:13.866474537 -0400
@@ -11,7 +11,7 @@
 	address 192.168.100.1
 	netmask 255.255.255.0
 	network 192.168.100.0
-	broadcast 192.168.1.255
+	broadcast 192.168.100.255
 	gateway 192.168.100.254
 	# dns-* options are implemented by the resolvconf package, if installed
 	dns-nameservers 192.168.100.254
16:45:31
#ping 192.168.100.2
PING 192.168.100.2 (192.168.100.2) 56(84) bytes of data.
^[[A^[[B^C
--- 192.168.100.2 ping statistics ---
46 packets transmitted, 0 received, 100% packet loss, time 45342ms
16:46:46
#/etc/init.d/network
networking       network-manager
16:46:46
#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
Reconfiguring network interfaces...done.
16:47:07
#ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global eth0
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 16:8c:99:fe:78:76 brd ff:ff:ff:ff:ff:ff
16:48:16
#ping 192.168.100.2
connect: Network is unreachable
16:48:59
#/etc/init.d/network-manager stop
Stopping network connection manager: NetworkManager already stopped.
16:51:23
#ping 192.168.90.1
PING 192.168.90.1 (192.168.90.1) 56(84) bytes of data.
64 bytes from 192.168.90.1: icmp_req=1 ttl=63 time=0.622 ms
64 bytes from 192.168.90.1: icmp_req=2 ttl=63 time=0.449 ms
64 bytes from 192.168.90.1: icmp_req=3 ttl=63 time=0.558 ms
64 bytes from 192.168.90.1: icmp_req=4 ttl=63 time=0.437 ms
^C
--- 192.168.90.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.437/0.516/0.622/0.080 ms
16:51:33
#ping 192.168.100.2
PING 192.168.100.2 (192.168.100.2) 56(84) bytes of data.
^C
--- 192.168.100.2 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6047ms
16:51:42
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.100.254 icmp_seq=1 Destination Host Unreachable
From 192.168.100.254 icmp_seq=2 Destination Host Unreachable
From 192.168.100.254 icmp_seq=3 Destination Host Unreachable
From 192.168.100.254 icmp_seq=4 Destination Host Unreachable
From 192.168.100.254 icmp_seq=5 Destination Host Unreachable
From 192.168.100.254 icmp_seq=6 Destination Host Unreachable
From 192.168.100.254 icmp_seq=7 Destination Host Unreachable
From 192.168.100.254 icmp_seq=8 Destination Host Unreachable
From 192.168.100.254 icmp_seq=9 Destination Host Unreachable
...
From 192.168.100.254 icmp_seq=17 Destination Host Unreachable
From 192.168.100.254 icmp_seq=18 Destination Host Unreachable
From 192.168.100.254 icmp_seq=19 Destination Host Unreachable
From 192.168.100.254 icmp_seq=20 Destination Host Unreachable
From 192.168.100.254 icmp_seq=21 Destination Host Unreachable
From 192.168.100.254 icmp_seq=22 Destination Host Unreachable
From 192.168.100.254 icmp_seq=23 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
23 packets transmitted, 0 received, +23 errors, 100% packet loss, time 21998ms
16:52:08
#cat /etc/resolv.conf
search nt10
nameserver 192.168.15.254
16:52:19
#nano /etc/resolv.conf
--- /tmp/l3-saved-10912.17628.31457	2012-10-22 10:52:29.947551901 -0400
+++ /etc/resolv.conf	2012-10-22 10:52:39.015824419 -0400
@@ -1,2 +1,2 @@
 search nt10
-nameserver 192.168.15.254
+nameserver 192.168.100.254
16:52:39
#search nt10
search nt10
nameserver 192.168.100.254
16:52:42
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
15 packets transmitted, 0 received, 100% packet loss, time 13999ms
16:53:28
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data.
^[[A^[[B^[[B^[[A^[[C^[[D^C
--- 10.0.35.1 ping statistics ---
76 packets transmitted, 0 received, 100% packet loss, time 75543ms
16:54:51
#^C

16:54:51
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_req=1 ttl=63 time=0.446 ms
64 bytes from 10.0.35.1: icmp_req=2 ttl=63 time=0.408 ms
64 bytes from 10.0.35.1: icmp_req=3 ttl=63 time=0.419 ms
^C
--- 10.0.35.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.408/0.424/0.446/0.023 ms
16:55:22
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6049ms
16:55:32
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=49 time=31.9 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=49 time=31.7 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=49 time=32.2 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=49 time=31.9 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 31.798/31.992/32.298/0.224 ms
16:57:03
#ping google.com
ping: unknown host google.com
16:59:50
#dig

17:01:26
#dig @192.168.15.254 ya.ru
; <<>> DiG 9.7.3 <<>> @192.168.15.254 ya.ru
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Вторник (10/23/12)

/dev/pts/1
08:17:09
#ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global eth0
    inet6 fe80::20f:feff:fe7e:b94f/64 scope link
       valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether b6:e3:1b:7f:fd:5a brd ff:ff:ff:ff:ff:ff
/dev/pts/2
08:17:09
#ip addr sh
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0f:fe:7e:b9:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global eth0
    inet6 fe80::20f:feff:fe7e:b94f/64 scope link
       valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether b6:e3:1b:7f:fd:5a brd ff:ff:ff:ff:ff:ff
прошло 23 минуты
/dev/pts/1
08:40:49
#/etc/init.d/network
networking       network-manager
/dev/pts/2
08:40:49
#/etc/init.d/network
networking       network-manager
/dev/pts/1
08:40:49
#/etc/init.d/network-manager stop
Stopping network connection manager: NetworkManager.

Файлы

  • /etc/host
  • /etc/hosts
  • /etc/init.d/asterisk
  • /etc/resolv.conf
  • sip.conf
  • /etc/host
    >
    host.conf    hostname     hosts        hosts.allow  hosts.deny
    
    /etc/hosts
    >
    127.0.0.1       localhost
    192.168.1.10    unix.nt10       unix
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    
    /etc/init.d/asterisk
    >
    #!/bin/sh
    #
    # asterisk      start the asterisk PBX
    # (c) Mark Purcell <msp@debian.org>
    # (c) Tzafrir Cohen <tzafrir.cohen@xorcom.com>
    # (c) Faidon Liambotis <paravoid@debian.org>
    #
    #   This package is free software; you can redistribute it and/or modify
    #   it under the terms of the GNU General Public License as published by
    #   the Free Software Foundation; either version 2 of the License, or
    #   (at your option) any later version.
    #
    ### BEGIN INIT INFO
    # Provides:          asterisk
    # Required-Start:    $remote_fs
    # Required-Stop:     $remote_fs
    # Should-Start:      $syslog $network $named mysql postgresql dahdi
    # Should-Stop:       $syslog $network $named mysql postgresql
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Asterisk PBX
    # Description:       Controls the Asterisk PBX
    ### END INIT INFO
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    NAME=asterisk
    USER=$NAME
    GROUP=$USER
    DAEMON=/usr/sbin/$NAME
    CANARY=/usr/sbin/astcanary
    DESC="Asterisk PBX"
    PIDFILE="/var/run/asterisk/asterisk.pid"
    ASTSAFE_PIDFILE="/var/run/asterisk/asterisk_safe.pid"
    UMASK=007 # by default
    #MAXFILES=1024 # (the system default)
    . /lib/lsb/init-functions
    # by default: use real-time priority
    PARAMS=""
    CHDIR_PARM=""
    AST_REALTIME="yes"
    RUNASTERISK="yes"
    AST_DUMPCORE="no"
    AST_DUMPCORE_DIR="/var/spool/asterisk" # only used if AST_DUMPCORE != no
    # core_pattern. See: http://lxr.linux.no/source/Documentation/sysctl/kernel.txt
    #CORE_PATTERN=
    if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME; fi
    if [ "$RUNASTERISK" != "yes" ];then
            echo "Asterisk not yet configured. Edit /etc/default/asterisk first."
            exit 0
    fi
    if [ "$AST_REALTIME" != "no" ]
    then
      PARAMS="$PARAMS -p"
    fi
    if [ "$AST_DUMPCORE" != "no" ]
    then
            PARAMS="$PARAMS -g"
            if [ "$CORE_PATTERN" != '' ]
            then
                    echo "$CORE_PATTERN" >/proc/sys/kernel/core_pattern
            fi
            if [ -d "$AST_DUMPCORE_DIR" ]
            then
                    CHDIR_PARM="--chdir $AST_DUMPCORE_DIR"
            fi
    fi
    if [ "x$USER" = "x" ]
    then
      echo "Error: empty USER name"
      exit 1
    fi
    if [ `id -u "$USER"` = 0 ]
    then
      echo "Starting as root not supported."
      exit 1
    fi
    PARAMS="$PARAMS -U $USER"
    if [ "x$AST_DEBUG_PARAMS" = x ]
    then
      AST_DEBUG_PARAMS=-cvvvvvddddd
    fi
    if [ "$RUNASTSAFE" = "yes" ];then
            # The value of WRAPPER_DAEMON in can be set in /etc/default/asterisk
            WRAPPER_DAEMON=${WRAPPER_DAEMON:-/usr/sbin/safe_asterisk}
            REALDAEMON="$WRAPPER_DAEMON"
    else
            REALDAEMON="$DAEMON"
    fi
    test -x $DAEMON || exit 0
    for dir in /var/run/asterisk /var/log/asterisk /var/log/asterisk/cdr-csv /var/log/asterisk/cdr-custom; do
            [ -d $dir ] || install -d -o $USER -g $GROUP $dir
    done
    set -e
    if [ "$UMASK" != '' ]
    then
            umask $UMASK
    fi
    # allow changing the per-process open files limit:
    if [ "$MAXFILES" != '' ]
    then
            ulimit -n $MAXFILES
    fi
    status() {
            status_of_proc "$DAEMON" "$DESC" && return 0 || return $?
    }
    asterisk_rx() {
            if ! status >/dev/null; then return 0; fi
            # if $HOME is set, asterisk -rx writes a .asterisk_history there
            (
                    unset HOME
                    $DAEMON -rx "$1"
            )
    }
    case "$1" in
      debug)
            # we add too many special parameters that I don't want to skip
            # accidentally. I'm afraid that skipping -U once may cause
            # confusing results. I also want to maintain the user's choice
            # of -p
            echo "Debugging $DESC: "
            $DAEMON $PARAMS $AST_DEBUG_PARAMS
            exit 0
            ;;
      start)
            if status > /dev/null; then
                    echo "$DESC is already running. Use restart."
                    exit 0
            fi
            echo -n "Starting $DESC: "
            if [ "$RUNASTSAFE" != "yes" ];then
                    # TODO: what if we cought the wrapper just as its asterisk
                    # was killed? status should check for the wrapper if we're in
                    # "safe mode"
                    if status > /dev/null; then
                            echo "$DESC is already running. Use restart."
                            exit 0
                    fi
                    start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
                            $CHDIR_PARM \
                            --exec $REALDAEMON -- $PARAMS > /dev/null
            else
                    start-stop-daemon --start --group $GROUP \
                            --background --make-pidfile \
                            $CHDIR_PARM --pidfile "$ASTSAFE_PIDFILE" \
                            --exec $REALDAEMON -- $PARAMS
            fi
            echo "$NAME."
            ;;
      stop)
            echo -n "Stopping $DESC: $NAME"
            # Try gracefully.
            # this may hang in some cases. Specifically, when the asterisk
            # processes is stopped. No bother to worry about cleanup:
            # it will either fail or die when asterisk dies.
            ( asterisk_rx 'core stop now' > /dev/null 2>&1 & ) &
            if [ "$RUNASTSAFE" = "yes" ];then
                    start-stop-daemon --stop --quiet --oknodo \
                                      --pidfile $ASTSAFE_PIDFILE
                    rm -f $ASTSAFE_PIDFILE
            fi
            # just making sure it's really, really dead.
            # KILL is necessary just in case there's an asterisk -r in the background
            start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $DAEMON
            start-stop-daemon --stop --quiet --oknodo --retry=0/2/TERM/2/KILL/5 --exec $CANARY
            echo "."
            ;;
      reload)
            echo "Reloading $DESC configuration files."
            asterisk_rx 'module reload'
            ;;
      logger-reload)
            asterisk_rx 'logger reload'
            ;;
      extensions-reload|dialplan-reload)
            echo "Reloading $DESC configuration files."
            asterisk_rx 'dialplan reload'
            ;;
      restart-convenient)
            asterisk_rx 'core restart when convenient'
            ;;
      restart|force-reload)
            $0 stop
            $0 start
            ;;
      status)
            status
            exit $?
            ;;
      *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop|restart|reload|status|debug|logger-reload|extensions-reload|restart-convenient|force-reload}" >&2
            exit 1
            ;;
    esac
    exit 0
    
    /etc/resolv.conf
    >
    search nt10
    nameserver 192.168.15.254
    
    sip.conf
    >
    [general]
    context=default                 ; Default context for incoming calls
    allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
    udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
    tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
    tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
    srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
    [authentication]
    [basic-options](!)                ; a template
            dtmfmode=rfc2833
            context=from-office
            type=friend
    [natted-phone](!,basic-options)   ; another template inheriting basic-options
            nat=yes
            directmedia=no
            host=dynamic
    [public-phone](!,basic-options)   ; another template inheriting basic-options
            nat=no
            directmedia=yes
    [my-codecs](!)                    ; a template for my preferred codecs
            disallow=all
            allow=ilbc
            allow=g729
            allow=gsm
            allow=g723
            allow=ulaw
    [ulaw-phone](!)                   ; and another one for ulaw-only
            disallow=all
            allow=ulaw
    

    Статистика

    Время первой команды журнала13:43:53 2012-10-22
    Время последней команды журнала08:40:49 2012-10-23
    Количество командных строк в журнале100
    Процент команд с ненулевым кодом завершения, %22.00
    Процент синтаксически неверно набранных команд, % 0.00
    Суммарное время работы с терминалом *, час 2.96
    Количество командных строк в единицу времени, команда/мин 0.56
    Частота использования команд
    ping14|============| 12.17%
    grep12|==========| 10.43%
    cat10|========| 8.70%
    ls10|========| 8.70%
    nano5|====| 4.35%
    ip5|====| 4.35%
    less4|===| 3.48%
    /etc/init.d/network3|==| 2.61%
    asterisk3|==| 2.61%
    '3|==| 2.61%
    expand3|==| 2.61%
    mv3|==| 2.61%
    /etc/init.d/asterisk2|=| 1.74%
    /etc/init.d/saned2|=| 1.74%
    netstat2|=| 1.74%
    lsof2|=| 1.74%
    apt-get2|=| 1.74%
    sed2|=| 1.74%
    dig2|=| 1.74%
    apt-cache2|=| 1.74%
    /etc/init.d/network-manager2|=| 1.74%
    dpkg1|| 0.87%
    man1|| 0.87%
    ntpdate1|| 0.87%
    sip.conf1|| 0.87%
    runlevel1|| 0.87%
    /etc/init.d/a1|| 0.87%
    /etc/init.d/networking1|| 0.87%
    w1|| 0.87%
    ps1|| 0.87%
    l3-agent1|| 0.87%
    127.0.0.11|| 0.87%
    ifup1|| 0.87%
    route1|| 0.87%
    [general]1|| 0.87%
    ifdown1|| 0.87%
    vi1|| 0.87%
    !-11|| 0.87%
    !-31|| 0.87%
    ^C1|| 0.87%
    allow=ula1|| 0.87%
    date1|| 0.87%
    search1|| 0.87%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$