Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Harry Coin <hcoin <at> n4comm.com>
Subject: Bug#414176: /sbin/halt .. -i .. in etch breaks WOL, doesn't do SIOCSIFFLAGS ioctl
Newsgroups: gmane.linux.debian.devel.bugs.general
Date: Friday 9th March 2007 18:05:30 UTC (over 9 years ago)
Package: sysvinit
Version: 2.86.ds1-38

Below please find two strace -iv outputs showing the binary version of halt

shipped in the latest (as of march 9, 07) Debian Etch ignores /sbin/halt's 
-i  (net down / breaking the wake on lan WOL function for 3com related 
cards ) switch, and possibly others, while the compiled version from source

does the right thing (and is a larger binary, to boot).

The  Debain Etch version of /sbin/halt .. -i ... does not execute the 
following, while the version compiled from source does:
...
ioctl(3, SIOCSIFFLAGS, 0xaf9be6c4) = 0
...

As a result, wake on lan (WOL) fails under Debain etch (at least for the 
3Com family of network cards) if one uses the supplied /sbin/halt, while it

works perfectly if compiled from source.

The two strace -iv outputs follow, except for the IP, they differ only in 
that one added line.

Here is the strace -iv from Debian Etch (that fails to call SIOCSIFFLAGS )

[a7e413ba] execve("/home/library/etchhalt", ["/home/library/etchhalt", 
"-w", "-d", "-f", "-i"], ["SHELL=/bin/bash", "TERM=linux", 
"HUSHLOGIN=FALSE", "USER=root", "MAIL=/var/mail/root", 
"PATH=/usr/local/sbin:/usr/local/"..., "PWD=/home/library", 
"LANG=en_US.UTF-8", "PS1=\\h:\\w\\$ ", "SHLVL=1", "HOME=/root", 
"LOGNAME=root", "VISUAL=/usr/bin/sensible-nedit", "_=/usr/bin/strace", 
"OLDPWD=/"]) = 0
[a7f349ed] uname({sysname="Linux", nodename="mythbackend4", 
release="2.6.18mythbackend", version="#7 Thu Mar 8 17:32:18 CST 2007", 
machine="i686"}) = 0
[a7f33edb] brk(0)                       = 0x804c000
[a7f34781] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
[a7f34933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7f22000
[a7f34781] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
[a7f34933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7f21000
[a7f34644] open("/etc/ld.so.cache", O_RDONLY) = 3
[a7f3460e] fstat64(3, {st_dev=makedev(0, 14), st_ino=19795738, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=16384, 
st_blocks=64, st_size=29412, st_atime=2007/03/09-11:24:50, 
st_mtime=2007/03/08-17:40:34, st_ctime=2007/03/08-17:41:12}) = 0
[a7f34933] mmap2(NULL, 29412, PROT_READ, MAP_PRIVATE, 3, 0) = 0xa7f19000
[a7f3467d] close(3)                     = 0
[a7f34781] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
[a7f34644] open("/lib/tls/libc.so.6", O_RDONLY) = 3
[a7f346c4] 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
[a7f3460e] fstat64(3, {st_dev=makedev(0, 14), st_ino=13076122, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=16384, 
st_blocks=2440, st_size=1241392, st_atime=2007/03/09-11:24:50, 
st_mtime=2007/02/21-09:13:50, st_ctime=2007/03/06-14:49:36}) = 0
[a7f34933] mmap2(NULL, 1251484, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7de7000
[a7f34933] mmap2(0xa7f0f000, 28672, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xa7f0f000
[a7f34933] mmap2(0xa7f16000, 10396, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa7f16000
[a7f3467d] close(3)                     = 0
[a7f34933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7de6000
[a7f349b4] mprotect(0xa7f0f000, 20480, PROT_READ) = 0
[a7f26c11] set_thread_area({entry_number:-1 -> 6, base_addr:0xa7de66c0, 
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,

seg_not_present:0, useable:1}) = 0
[a7f34971] munmap(0xa7f19000, 29412)    = 0
[a7e75e1a] geteuid32()                  = 0
[a7ea44fd] chdir("/")                   = 0
[a7eab957] sync()                       = 0
[a7e0fce4] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[a7e0fbd8] rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
[a7e0fce4] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[a7e7503b] nanosleep({2, 0}, {2, 0})    = 0
[a7eb39d2] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
[a7eaad04] ioctl(3, SIOCGIFCONF, {64, {{"lo", {AF_INET, 
inet_addr("127.0.0.1")}}, {"eth0", {AF_INET, inet_addr("192.168.0.14")}}}})
= 0
----  Missing ioctl here to turn on WOL ---
[a7ea3d07] close(3)                     = 0
[a7e7537f] exit_group(0)                = ?

Here is the halt compiled from sysvinit-2.86.ds1 source:

[a7f2f3ba] execve("/sbin/halt", ["halt", "-w", "-d", "-f", "-i"], 
["SHELL=/bin/bash", "TERM=linux", "HUSHLOGIN=FALSE", "USER=root", 
"MAIL=/var/mail/root", "PATH=/usr/local/sbin:/usr/local/"..., "PWD=/root", 
"LANG=en_US.UTF-8", "PS1=\\h:\\w\\$ ", "SHLVL=1", "HOME=/root", 
"LOGNAME=root", "VISUAL=/usr/bin/sensible-nedit", "_=/usr/bin/strace"]) = 0
[a7fd29ed] uname({sysname="Linux", nodename="mythbackend4", 
release="2.6.18mythbackend", version="#7 Thu Mar 8 17:32:18 CST 2007", 
machine="i686"}) = 0
[a7fd1edb] brk(0)                       = 0x804b000
[a7fd2781] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
[a7fd2933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7fc0000
[a7fd2781] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or 
directory)
[a7fd2933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7fbf000
[a7fd2644] open("/etc/ld.so.cache", O_RDONLY) = 3
[a7fd260e] fstat64(3, {st_dev=makedev(0, 14), st_ino=19795738, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=16384, 
st_blocks=64, st_size=29412, st_atime=2007/03/09-11:16:29, 
st_mtime=2007/03/08-17:40:34, st_ctime=2007/03/08-17:41:12}) = 0
[a7fd2933] mmap2(NULL, 29412, PROT_READ, MAP_PRIVATE, 3, 0) = 0xa7fb7000
[a7fd267d] close(3)                     = 0
[a7fd2781] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
[a7fd2644] open("/lib/tls/libc.so.6", O_RDONLY) = 3
[a7fd26c4] 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
[a7fd260e] fstat64(3, {st_dev=makedev(0, 14), st_ino=13076122, 
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=16384, 
st_blocks=2440, st_size=1241392, st_atime=2007/03/09-11:16:29, 
st_mtime=2007/02/21-09:13:50, st_ctime=2007/03/06-14:49:36}) = 0
[a7fd2933] mmap2(NULL, 1251484, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7e85000
[a7fd2933] mmap2(0xa7fad000, 28672, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xa7fad000
[a7fd2933] mmap2(0xa7fb4000, 10396, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa7fb4000
[a7fd267d] close(3)                     = 0
[a7fd2933] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7e84000
[a7fd29b4] mprotect(0xa7fad000, 20480, PROT_READ) = 0
[a7fc4c11] set_thread_area({entry_number:-1 -> 6, base_addr:0xa7e846c0, 
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,

seg_not_present:0, useable:1}) = 0
[a7fd2971] munmap(0xa7fb7000, 29412)    = 0
[a7f13e1a] geteuid32()                  = 0
[a7f424fd] chdir("/")                   = 0
[a7f49957] sync()                       = 0
[a7eadce4] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[a7eadbd8] rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
[a7eadce4] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[a7f1303b] nanosleep({2, 0}, {2, 0})    = 0
[a7f519d2] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
[a7f48d04] ioctl(3, SIOCGIFCONF, {64, {{"lo", {AF_INET, 
inet_addr("127.0.0.1")}}, {"eth0", {AF_INET, inet_addr("192.168.0.14")}}}})
= 0
[a7f48d04] ioctl(3, SIOCSIFFLAGS, 0xaf9be6c4) = 0     <--- This ioctl is 
correct and WOL works using this /sbin/halt
[a7f41d07] close(3)                     = 0
[a7f1337f] exit_group(0)                = ?

Thanks

Harry Coin
 
CD: 14ms