wiki:jazz/09-01-22

Version 1 (modified by jazz, 16 years ago) (diff)

--

2009-01-22

  • 用 strace init 0 觀察關機程序
    root@debian:~/sysvinit-2.86.ds1/src# strace init 0
    execve("/sbin/init", ["init", "0"], [/* 14 vars */]) = 0
    uname({sys="Linux", node="debian", ...}) = 0
    brk(0)                                  = 0x8051000
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f8c000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=18455, ...}) = 0
    mmap2(NULL, 18455, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f87000
    close(3)                                = 0
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    open("/lib/libsepol.so.1", O_RDONLY)    = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0200\0"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0644, st_size=219824, ...}) = 0
    mmap2(NULL, 265152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f46000
    mmap2(0xb7f7c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x35) = 0xb7f7c000
    mmap2(0xb7f7d000, 39872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f7d000
    close(3)                                = 0
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    open("/lib/libselinux.so.1", O_RDONLY)  = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P8\0\000"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0644, st_size=79368, ...}) = 0
    mmap2(NULL, 84884, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f31000
    mmap2(0xb7f44000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb7f44000
    close(3)                                = 0
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240O\1"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0644, st_size=1241392, ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f30000
    mmap2(NULL, 1247388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dff000
    mmap2(0xb7f26000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xb7f26000
    mmap2(0xb7f2d000, 10396, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f2d000
    close(3)                                = 0
    access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
    open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\f\0"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0644, st_size=9592, ...}) = 0
    mmap2(NULL, 12404, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dfb000
    mmap2(0xb7dfd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7dfd000
    close(3)                                = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dfa000
    mprotect(0xb7f26000, 20480, PROT_READ)  = 0
    set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dfa6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, usea                                                                             ble:1}) = 0
    munmap(0xb7f87000, 18455)               = 0
    access("/etc/selinux/", F_OK)           = -1 ENOENT (No such file or directory)
    brk(0)                                  = 0x8051000
    brk(0x8072000)                          = 0x8072000
    open("/proc/mounts", O_RDONLY|O_LARGEFILE) = 3
    fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f8b000
    read(3, "rootfs / rootfs rw 0 0\nnone /sys"..., 1024) = 305
    read(3, "", 1024)                       = 0
    close(3)                                = 0
    munmap(0xb7f8b000, 4096)                = 0
    umask(022)                              = 022
    geteuid32()                             = 0
    getpid()                                = 2159
    rt_sigaction(SIGALRM, {0x8049ad0, [], 0}, NULL, 8) = 0
    alarm(3)                                = 0
    open("/dev/initctl", O_WRONLY)          = 3
    write(3, "i\31\t\3\1\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
    close(3)                                = 0
    alarm(0)                                = 3
    exit_group(0)                           = ?
    Process 2159 detached
    root@debian:~/sysvinit-2.86.ds1/src#
    

Attachments (1)

Download all attachments as: .zip