Steve, Can you please tell me how a container can be granted access to real devices like network interfaces <http://en.wikipedia.org/wiki/Network_interface>, serial ports <http://en.wikipedia.org/wiki/Serial_port>, disk partitions<http://en.wikipedia.org/wiki/Disk_partition>, etc ?
Thanks a lot for your time! Vidhya On Fri, Jun 26, 2009 at 1:45 PM, Vidhya Nagarajan <[email protected]> wrote: > Hello Steve, > > Thanks for you reply! Here is what I get when I do an strace. > > I guess the container need a dedicated disk device and since it doesn't > have one at the momet, its seg faulting. How would I share a disk device > with a container? > > > [r...@rajeshr-linux bin]# strace ./monitord -s localhost -p 8367 -d -v > execve("./monitord", ["./monitord", "-s", "localhost", "-p", "8367", "-d", > "-v"], [/* 17 vars */]) = 0 > brk(0) = 0x9c4f000 > uname({sys="Linux", node="rajeshr-linux", ...}) = 0 > 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=9708, ...}) = 0 > mmap2(NULL, 9708, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ffb000 > close(3) = 0 > open("/lib/libpthread.so.0", 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\360G\0\0004\0\0\0"..., 512) > = 512 > fstat64(3, {st_mode=S_IFREG|0755, st_size=127700, ...}) = 0 > mmap2(NULL, 94688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = > 0x888000 > mmap2(0x89c000, 8192, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0x89c000 > mmap2(0x89e000, 4576, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x89e000 > close(3) = 0 > open("/lib/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\320`\1\0004\0\0\0"..., 512) > = 512 > fstat64(3, {st_mode=S_IFREG|0755, st_size=1670312, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffa000 > mmap2(NULL, 1390032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) > = 0x2d1000 > mmap2(0x41f000, 12288, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14e) = 0x41f000 > mmap2(0x422000, 9680, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x422000 > close(3) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ff9000 > set_thread_area({entry_number:-1 -> 6, base_addr:0xb7ff96c0, limit:1048575, > seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, > seg_not_present:0, useable:1}) = 0 > mprotect(0x41f000, 8192, PROT_READ) = 0 > mprotect(0x89c000, 4096, PROT_READ) = 0 > mprotect(0x856000, 4096, PROT_READ) = 0 > munmap(0xb7ffb000, 9708) = 0 > set_tid_address(0xb7ff9708) = 3761 > set_robust_list(0xb7ff9710, 0xc) = 0 > rt_sigaction(SIGRTMIN, {0x88c2e0, [], SA_RESTORER|SA_SIGINFO, 0x895290}, > NULL, 8) = 0 > rt_sigaction(SIGRT_1, {0x88c360, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, > 0x895290}, NULL, 8) = 0 > rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 > getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0 > uname({sys="Linux", node="rajeshr-linux", ...}) = 0 > socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3 > brk(0) = 0x9c4f000 > brk(0x9c70000) = 0x9c70000 > open("/etc/resolv.conf", O_RDONLY) = 4 > fstat64(4, {st_mode=S_IFREG|0644, st_size=20, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffd000 > read(4, "nameserver 10.0.2.1\n", 4096) = 20 > read(4, "", 4096) = 0 > close(4) = 0 > munmap(0xb7ffd000, 4096) = 0 > uname({sys="Linux", node="rajeshr-linux", ...}) = 0 > socket(PF_FILE, SOCK_STREAM, 0) = 4 > fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 > connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 > ENOENT (No such file or directory) > close(4) = 0 > socket(PF_FILE, SOCK_STREAM, 0) = 4 > fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 > connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 > ENOENT (No such file or directory) > close(4) = 0 > open("/etc/nsswitch.conf", O_RDONLY) = 4 > fstat64(4, {st_mode=S_IFREG|0644, st_size=1696, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffd000 > read(4, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1696 > read(4, "", 4096) = 0 > close(4) = 0 > munmap(0xb7ffd000, 4096) = 0 > open("/etc/ld.so.cache", O_RDONLY) = 4 > fstat64(4, {st_mode=S_IFREG|0644, st_size=9708, ...}) = 0 > mmap2(NULL, 9708, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7ffb000 > close(4) = 0 > open("/lib/libnss_files.so.2", O_RDONLY) = 4 > read(4, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\30\0\0004\0\0\0"..., > 512) = 512 > fstat64(4, {st_mode=S_IFREG|0755, st_size=50840, ...}) = 0 > mmap2(NULL, 45712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = > 0x649000 > mmap2(0x653000, 8192, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9) = 0x653000 > close(4) = 0 > mprotect(0x653000, 4096, PROT_READ) = 0 > munmap(0xb7ffb000, 9708) = 0 > open("/etc/host.conf", O_RDONLY) = 4 > fstat64(4, {st_mode=S_IFREG|0644, st_size=17, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffd000 > read(4, "order hosts,bind\n", 4096) = 17 > read(4, "", 4096) = 0 > close(4) = 0 > munmap(0xb7ffd000, 4096) = 0 > futex(0x4237e0, FUTEX_WAKE, 2147483647) = 0 > open("/etc/hosts", O_RDONLY) = 4 > fcntl64(4, F_GETFD) = 0 > fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 > fstat64(4, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffd000 > read(4, "127.0.0.1 localhost.localdomain "..., 4096) = 42 > close(4) = 0 > munmap(0xb7ffd000, 4096) = 0 > fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffd000 > write(1, "Just defined sockaddr->sin_addr."..., 50Just defined > sockaddr->sin_addr.in_addr=(100007f) > ) = 50 > open("/proc/stat", O_RDONLY) = 4 > fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb7ffc000 > read(4, "cpu 107 0 137 3102929 8 0 0 0\nc"..., 4096) = 159 > close(4) = 0 > munmap(0xb7ffc000, 4096) = 0 > open("/proc/diskstats", O_RDONLY) = -1 ENOENT (No such file or > directory) > --- SIGSEGV (Segmentation fault) @ 0 (0) --- > +++ killed by SIGSEGV +++ > > Thanks, > Vidhya > > > On Fri, Jun 26, 2009 at 12:06 PM, Steven Tardy <[email protected]>wrote: > >> Vidhya Nagarajan wrote: >> >>> Hello everyone, >>> >>> I am new to OpenVZ and so far I have liked it a lot. The Quick >>> installation >>> guide is extremely useful. I am trying to run a thermal emulation model >>> inside a container. I have installed all the necessary packages, However, >>> When I run the thermal emulation software which basically collects the >>> power >>> consumed by the components(cpu,network,disk) of the machine, I get a >>> segmentation fault. When I run the same in the host node, I don't get any >>> error and the software runs smoothly. >>> >>> For the thermal emulation model I need to set the /dev/sda properly. >>> However >>> when I tried to run /dev from the container I could not get sda or hda >>> but >>> rather found "pts". what does that mean? >>> >>> >>> From inside the container : >>>> >>> >>> [r...@rajeshr-linux bin]# ./monitord -p 8367 -s localhost -d -v >>> Just defined sockaddr->sin_addr.in_addr=(100007f) >>> Segmentation fault >>> >>> Is it because the container is not given access to the power modules in >>> the >>> host node? I have mounted three of the folders from the host node to the >>> container using the command >>> >> >> that software probably reads from something in /proc >> >> troubleshooting 101 (strace): >> strace ./monitord -p 8367 -s localhost -d -v >> >> see what errors strace returns >> >> -- >> Steven Tardy >> Systems Programmer >> Information Technology Infrastructure >> Information Technology Services >> Mississippi State University >> [email protected] >> _______________________________________________ >> Users mailing list >> [email protected] >> https://openvz.org/mailman/listinfo/users >> > > >
_______________________________________________ Users mailing list [email protected] https://openvz.org/mailman/listinfo/users
