Modify

Opened 2 years ago

Last modified 2 years ago

#20785 new defect

procd jails (e.g. dnsmasq) don't work on x86 trunk

Reported by: anonymous Owned by: developers
Priority: normal Milestone:
Component: base system Version: Trunk
Keywords: procd, jail, x86 Cc:

Description

I've been having problems with procd jails since 1+ month:

development@openwrt-devel:~/src/openwrt-trunk/openwrt$ fgrep -i jail .config
CONFIG_PACKAGE_procd-ujail=y
development@openwrt-devel:~/src/openwrt-trunk/openwrt$ fgrep -i dnsm .config
CONFIG_DEFAULT_dnsmasq=y
# CONFIG_PACKAGE_dnsmasq is not set
# CONFIG_PACKAGE_dnsmasq-dhcpv6 is not set
CONFIG_PACKAGE_dnsmasq-full=y
# CONFIG_PACKAGE_dnsmasq_full_dhcpv6 is not set
# CONFIG_PACKAGE_dnsmasq_full_dnssec is not set
# CONFIG_PACKAGE_dnsmasq_full_auth is not set
CONFIG_PACKAGE_dnsmasq_full_ipset=y
development@openwrt-devel:~/src/openwrt-trunk/openwrt$
root@OpenWrt:~# logread |fgrep dnsma
Thu Oct 22 20:58:46 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:58:46 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:58:49 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:58:49 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:58:51 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:58:51 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:58:53 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:58:53 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:58:58 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:58:58 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:59:03 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:59:03 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:59:03 2015 daemon.info procd: Instance dnsmasq::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
Thu Oct 22 20:59:06 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:59:06 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
Thu Oct 22 20:59:19 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Thu Oct 22 20:59:19 2015 user.err : jail: failed to spawn child /usr/sbin/dnsmasq: No such file or directory
root@OpenWrt:~# uname -a
Linux OpenWrt 3.18.21 #1 SMP Thu Oct 22 20:37:47 EEST 2015 i686 GNU/Linux
root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r47245'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='x86/kvm_guest'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r47245'
DISTRIB_TAINTS=''
root@OpenWrt:~#

Attachments (1)

strace-procd-dnsmasq.txt (148.5 KB) - added by anonymous 2 years ago.
Output of "strace -p 1 -f"

Download all attachments as: .zip

Change History (13)

comment:1 Changed 2 years ago by anonymous

I get the same errors with a freshly compiled DD trunk r42278 for x86

Could someone who is using jails successfully on trunk please suggest how it's done?

root@OpenWrt:~# logread |fgrep dnsm
Tue Oct 27 22:13:19 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:19 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:21 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:21 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:22 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:22 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:23 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:23 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:28 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:28 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:33 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:33 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:33 2015 daemon.info procd: Instance dnsmasq::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
Tue Oct 27 22:13:35 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:35 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
Tue Oct 27 22:13:47 2015 user.err : jail: /usr/share/dnsmasq/trust-anchors.conf does not exist
Tue Oct 27 22:13:47 2015 user.err : jail: failed to execve /usr/sbin/dnsmasq: No such file or directory
root@OpenWrt:~# uname -a
Linux OpenWrt 3.18.21 #1 SMP Tue Oct 27 22:04:08 EET 2015 i686 GNU/Linux
root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r47278'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='x86/kvm_guest'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r47278'
DISTRIB_TAINTS=''
root@OpenWrt:~#

comment:2 Changed 2 years ago by champetier.etienne@…

hi both,

can you try dnsmasq "normal" (not full)?
can you try CC instead of trunk? (you might need https://patchwork.ozlabs.org/patch/538039/)

can you try to strace the process and send the logs?
you'll need "strace", and for a procd service:
#in one terminal
strace -p 1 -f # trace pid 1 (procd) and follow forks
#in another terminal
/etc/init.d/dnsmasq restart

thanks in advance guys

p.s: dnsmasq normal working for me on CC ar71xx

comment:3 Changed 2 years ago by anonymous

Hi, I'm waiting for the devs to merge your latest patch before recompiling / reinstalling / retesting it.

Thank you for your work!

comment:4 Changed 2 years ago by anonymous

root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r47459'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='x86/kvm_guest'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r47459'
DISTRIB_TAINTS=''
root@OpenWrt:~#
root@OpenWrt:~# fgrep dnsm /tmp/1
open("/var/etc/dnsmasq.conf", O_RDONLY|O_LARGEFILE) = 6
[pid  5082] execve("/etc/init.d/dnsmasq", ["/etc/init.d/dnsmasq", "running"], [/* 6 vars */]Process 5081 attached
[pid  5081] execve("/sbin/ujail", ["/sbin/ujail", "-n", "dnsmasq", "-P", "/tmp/.jail/dnsmasq", "-u", "-l", "-r", "/dev/null", "-r", "/dev/urandom", "-r", "/etc/TZ", "-r", "/etc/dnsmasq.conf", "-w", ...], [/* 6 vars */] <unfinished ...>
[pid  5081] prctl(PR_SET_NAME, "dnsmasq\0-P\0/tmp/" <unfinished ...>
[pid  5081] mkdir("/tmp/.jail/dnsmasq", 0755) = 0
[pid  5082] open("/etc/init.d/dnsmasq", O_RDONLY|O_LARGEFILE) = 3
[pid  5082] <... read resumed> "\n\tpidof dnsmasq >/dev/null || \\\n"..., 511) = 511
[pid  5083] sethostname("dnsmasq", 7 <unfinished ...>
[pid  5083] mount("tmpfs", "/tmp/.jail/dnsmasq", "tmpfs", MS_NOATIME, "mode=0755" <unfinished ...>
[pid  5083] chdir("/tmp/.jail/dnsmasq" <unfinished ...>
[pid  5083] open("/lib64//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid  5083] open("/lib//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid  5083] open("/usr/lib//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid  5083] open("/usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755 <unfinished ...>
[pid  5083] mkdir("/tmp/.jail/dnsmasq/usr", 0755 <unfinished ...>
[pid  5083] mkdir("/tmp/.jail/dnsmasq/usr/sbin", 0755 <unfinished ...>
[pid  5083] stat64("/usr/sbin/dnsmasq",  <unfinished ...>
[pid  5083] open("/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644 <unfinished ...>
[pid  5083] mount("/usr/sbin/dnsmasq", "/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", NULL, MS_BIND, NULL <unfinished ...>
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/lib", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/lib/libc.so", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/lib/libc.so", "/tmp/.jail/dnsmasq/lib/libc.so", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/lib/libc.so", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/lib", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/lib/libgcc_s.so.1", "/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var", 0755) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/var/run/ubus.sock", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/var/run/ubus.sock", "/tmp/.jail/dnsmasq/var/run/ubus.sock", NULL, MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/dev/log", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/dev/log", "/tmp/.jail/dnsmasq/dev/log", NULL, MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/dev/null", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/dev/null", "/tmp/.jail/dnsmasq/dev/null", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/dev/null", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/dev/urandom", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/dev/urandom", "/tmp/.jail/dnsmasq/dev/urandom", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/dev/urandom", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/etc/TZ", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/TZ", "/tmp/.jail/dnsmasq/etc/TZ", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/TZ", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] stat64("/etc/dnsmasq.conf", {st_mode=S_IFREG|0644, st_size=1368, ...}) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/etc/dnsmasq.conf", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/dnsmasq.conf", "/tmp/.jail/dnsmasq/etc/dnsmasq.conf", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/dnsmasq.conf", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] stat64("/etc/dnsmasq.time", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/etc/dnsmasq.time", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/dnsmasq.time", "/tmp/.jail/dnsmasq/etc/dnsmasq.time", NULL, MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/etc/ethers", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/ethers", "/tmp/.jail/dnsmasq/etc/ethers", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/ethers", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/etc/group", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/group", "/tmp/.jail/dnsmasq/etc/group", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/group", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/etc/hosts", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/hosts", "/tmp/.jail/dnsmasq/etc/hosts", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/hosts", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/etc/passwd", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/etc/passwd", "/tmp/.jail/dnsmasq/etc/passwd", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/etc/passwd", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/tmp/dhcp.leases", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/tmp/dhcp.leases", "/tmp/.jail/dnsmasq/tmp/dhcp.leases", NULL, MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5083] stat64("/tmp/dnsmasq.d", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp/dnsmasq.d", 0755) = 0
[pid  5083] mount("/tmp/dnsmasq.d", "/tmp/.jail/dnsmasq/tmp/dnsmasq.d", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/tmp/dnsmasq.d", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp/hosts", 0755) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/tmp/hosts/dhcp", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/tmp/hosts/dhcp", "/tmp/.jail/dnsmasq/tmp/hosts/dhcp", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/tmp/hosts/dhcp", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5083] open("/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5083] mount("/tmp/resolv.conf.auto", "/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/usr", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/usr/share", 0755) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq/usr/share/dnsmasq", 0755) = 0
[pid  5083] stat64("/usr/share/dnsmasq/trust-anchors.conf", 0x814de4c) = -1 ENOENT (No such file or directory)
[pid  5083] writev(2, [{"jail: /usr/share/dnsmasq/trust-a"..., 59}, {NULL, 0}], 2) = 59
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var/etc", 0755) = 0
[pid  5083] stat64("/var/etc/dnsmasq.conf", {st_mode=S_IFREG|0644, st_size=503, ...}) = 0
[pid  5083] open("/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 5
[pid  5083] mount("/var/etc/dnsmasq.conf", "/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", NULL, MS_BIND, NULL) = 0
[pid  5083] mount(NULL, "/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = -1 EEXIST (File exists)
[pid  5083] stat64("/var/run/dnsmasq", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/var/run/dnsmasq", 0755) = 0
[pid  5083] mount("/var/run/dnsmasq", "/tmp/.jail/dnsmasq/var/run/dnsmasq", NULL, MS_BIND, NULL) = 0
[pid  5083] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5083] mkdir("/tmp/.jail/dnsmasq/old", 0755) = 0
[pid  5083] pivot_root("/tmp/.jail/dnsmasq", "/tmp/.jail/dnsmasq/old") = 0
[pid  5083] writev(1, [{"jail: exec-ing /usr/sbin/dnsmasq", 32}, {"\n", 1}], 2) = 33
[pid  5083] execve("/usr/sbin/dnsmasq", ["/usr/sbin/dnsmasq", "-C", "/var/etc/dnsmasq.conf", "-k", "-x", "/var/run/dnsmasq/dnsmasq.pid"], [/* 0 vars */]) = -1 ENOENT (No such file or directory)
[pid  5081] rmdir("/tmp/.jail/dnsmasq") = 0
[pid  5084] execve("/usr/bin/readlink", ["readlink", "/etc/init.d/dnsmasq"], [/* 6 vars */]) = 0
[pid  5084] readlink("/etc/init.d/dnsmasq", 0xb76c8d90, 80) = -1 EINVAL (Invalid argument)
[pid  5095] execve("/sbin/ujail", ["/sbin/ujail", "-n", "dnsmasq", "-P", "/tmp/.jail/dnsmasq", "-u", "-l", "-r", "/dev/null", "-r", "/dev/urandom", "-r", "/etc/TZ", "-r", "/etc/dnsmasq.conf", "-w", ...], [/* 6 vars */]) = 0
[pid  5095] prctl(PR_SET_NAME, "dnsmasq\0-P\0/tmp/") = 0
[pid  5095] mkdir("/tmp/.jail/dnsmasq", 0755) = 0
[pid  5096] sethostname("dnsmasq", 7)   = 0
[pid  5096] mount("tmpfs", "/tmp/.jail/dnsmasq", "tmpfs", MS_NOATIME, "mode=0755") = 0
[pid  5096] chdir("/tmp/.jail/dnsmasq") = 0
[pid  5096] open("/lib64//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  5096] open("/lib//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  5096] open("/usr/lib//usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  5096] open("/usr/sbin/dnsmasq", O_RDONLY|O_LARGEFILE) = 4
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/usr", 0755) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq/usr/sbin", 0755) = 0
[pid  5096] stat64("/usr/sbin/dnsmasq", {st_mode=S_IFREG|0755, st_size=175021, ...}) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/usr/sbin/dnsmasq", "/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/usr/sbin/dnsmasq", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/lib", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/lib/libc.so", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/lib/libc.so", "/tmp/.jail/dnsmasq/lib/libc.so", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/lib/libc.so", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/lib", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/lib/libgcc_s.so.1", "/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/lib/libgcc_s.so.1", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var", 0755) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/var/run/ubus.sock", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/var/run/ubus.sock", "/tmp/.jail/dnsmasq/var/run/ubus.sock", NULL, MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/dev/log", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/dev/log", "/tmp/.jail/dnsmasq/dev/log", NULL, MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/dev/null", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/dev/null", "/tmp/.jail/dnsmasq/dev/null", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/dev/null", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/dev", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/dev/urandom", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/dev/urandom", "/tmp/.jail/dnsmasq/dev/urandom", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/dev/urandom", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/etc/TZ", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/TZ", "/tmp/.jail/dnsmasq/etc/TZ", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/TZ", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] stat64("/etc/dnsmasq.conf", {st_mode=S_IFREG|0644, st_size=1368, ...}) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/etc/dnsmasq.conf", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/dnsmasq.conf", "/tmp/.jail/dnsmasq/etc/dnsmasq.conf", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/dnsmasq.conf", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] stat64("/etc/dnsmasq.time", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/etc/dnsmasq.time", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/dnsmasq.time", "/tmp/.jail/dnsmasq/etc/dnsmasq.time", NULL, MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/etc/ethers", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/ethers", "/tmp/.jail/dnsmasq/etc/ethers", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/ethers", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/etc/group", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/group", "/tmp/.jail/dnsmasq/etc/group", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/group", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/etc/hosts", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/hosts", "/tmp/.jail/dnsmasq/etc/hosts", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/hosts", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/etc", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/etc/passwd", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/etc/passwd", "/tmp/.jail/dnsmasq/etc/passwd", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/etc/passwd", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/tmp/dhcp.leases", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/tmp/dhcp.leases", "/tmp/.jail/dnsmasq/tmp/dhcp.leases", NULL, MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5096] stat64("/tmp/dnsmasq.d", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp/dnsmasq.d", 0755) = 0
[pid  5096] mount("/tmp/dnsmasq.d", "/tmp/.jail/dnsmasq/tmp/dnsmasq.d", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/tmp/dnsmasq.d", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp/hosts", 0755) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/tmp/hosts/dhcp", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/tmp/hosts/dhcp", "/tmp/.jail/dnsmasq/tmp/hosts/dhcp", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/tmp/hosts/dhcp", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/tmp", 0755) = -1 EEXIST (File exists)
[pid  5096] open("/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 4
[pid  5096] mount("/tmp/resolv.conf.auto", "/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/tmp/resolv.conf.auto", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/usr", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/usr/share", 0755) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq/usr/share/dnsmasq", 0755) = 0
[pid  5096] stat64("/usr/share/dnsmasq/trust-anchors.conf", 0x814de4c) = -1 ENOENT (No such file or directory)
[pid  5096] writev(2, [{"jail: /usr/share/dnsmasq/trust-a"..., 59}, {NULL, 0}], 2) = 59
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var/etc", 0755) = 0
[pid  5096] stat64("/var/etc/dnsmasq.conf", {st_mode=S_IFREG|0644, st_size=503, ...}) = 0
[pid  5096] open("/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 5
[pid  5096] mount("/var/etc/dnsmasq.conf", "/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", NULL, MS_BIND, NULL) = 0
[pid  5096] mount(NULL, "/tmp/.jail/dnsmasq/var/etc/dnsmasq.conf", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = -1 EEXIST (File exists)
[pid  5096] stat64("/var/run/dnsmasq", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var/run", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/var/run/dnsmasq", 0755) = 0
[pid  5096] mount("/var/run/dnsmasq", "/tmp/.jail/dnsmasq/var/run/dnsmasq", NULL, MS_BIND, NULL) = 0
[pid  5096] mkdir("/tmp/.jail/dnsmasq", 0755) = -1 EEXIST (File exists)
[pid  5096] mkdir("/tmp/.jail/dnsmasq/old", 0755) = 0
[pid  5096] pivot_root("/tmp/.jail/dnsmasq", "/tmp/.jail/dnsmasq/old") = 0
[pid  5096] writev(1, [{"jail: exec-ing /usr/sbin/dnsmasq", 32}, {"\n", 1}], 2) = 33
[pid  5096] execve("/usr/sbin/dnsmasq", ["/usr/sbin/dnsmasq", "-C", "/var/etc/dnsmasq.conf", "-k", "-x", "/var/run/dnsmasq/dnsmasq.pid"], [/* 0 vars */]) = -1 ENOENT (No such file or directory)
[pid  5095] rmdir("/tmp/.jail/dnsmasq") = 0
root@OpenWrt:~# ls -la /tmp/.jail/
drwxr-xr-x    2 root     root            40 Nov 11 21:24 .
drwxrwxrwt   15 root     root           400 Nov 11 21:24 ..
root@OpenWrt:~#

Changed 2 years ago by anonymous

Output of "strace -p 1 -f"

comment:5 follow-up: Changed 2 years ago by champetier.etienne@…

hi,

can you past the output of:

ldd dnsmasq

according to execve man, ENOENT mean no exec or missing shared lib
http://man7.org/linux/man-pages/man2/execve.2.html

comment:6 Changed 2 years ago by champetier.etienne@…

found it my self running
http://downloads.openwrt.org/snapshots/trunk/x86/64/openwrt-x86-64-combined-ext4.img.gz
with
qemu-system-x86_64 -M q35 -drive file=openwrt-x86-64-combined-ext4.img,id=d0,if=none,bus=0,unit=0 -device ide-hd,drive=d0,bus=ide.0

/lib/ld-musl-x86_64.so.1
libgcc_s.so.1 => /lib/libgcc_s.so.1
libc.so => /lib/libc.so

there is no mount("/lib/ld-musl-x86_64.so.1", ...)

with uclibc/CC, ldd dnsmasq looks like

libgcc_s.so.1 => /lib/libgcc_s.so.1
libc.so.0 => /lib/libc.so.0
ld-uClibc.so.0 => /lib/ld-uClibc.so.0

so there seems to be a bug in the ELF parsing code of ujail

comment:7 Changed 2 years ago by champetier.etienne@…

objdump are pretty similar

objdump -x -s (subtarget x86_64 / DD r47461)

Dynamic Section:
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so

Contents of section .interp:
 400200 2f6c6962 2f6c642d 6d75736c 2d783836  /lib/ld-musl-x86
 400210 5f36342e 736f2e31 00                 _64.so.1.       

objdump -x -s (subtarget ar7xxx / DD r47461)

Dynamic Section:
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so

Contents of section .interp:
 400134 2f6c6962 2f6c642d 6d75736c 2d6d6970  /lib/ld-musl-mip
 400144 732d7366 2e736f2e 3100               s-sf.so.1. 

objdump -x -s (subtarget ar7xxx / CC r47277)

Dynamic Section:
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.0

Contents of section .interp:
 400114 2f6c6962 2f6c642d 75436c69 62632e73  /lib/ld-uClibc.s
 400124 6f2e3000                             o.0.

comment:8 Changed 2 years ago by champetier.etienne@…

for the record
ujail is working with CC (uclibc), working on my ubuntu 14.04 ("normal" and lxc on centos6 host),
but not with DD musl kvm x86-64 (not adding "/lib/ld-musl-x86_64.so.1" into the jail)

comment:9 in reply to: ↑ 5 Changed 2 years ago by anonymous

Replying to champetier.etienne@…:

hi,

can you past the output of:

ldd dnsmasq

according to execve man, ENOENT mean no exec or missing shared lib
http://man7.org/linux/man-pages/man2/execve.2.html

Here is the output from DD r47459

root@OpenWrt:~# ldd
musl libc
Version 1.1.11
Dynamic Program Loader
Usage: ldd [options] [--] pathname
root@OpenWrt:~# ldd /usr/sbin/dnsmasq
        /lib/ld-musl-i386.so.1 (0xb76c3000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb76af000)
        libc.so => /lib/ld-musl-i386.so.1 (0xb76c3000)
root@OpenWrt:~# ls -la /lib/ld-musl-i386.so.1
lrwxrwxrwx    1 root     root             7 Nov 11 20:17 /lib/ld-musl-i386.so.1 -> libc.so
root@OpenWrt:~# ls -la /lib/libc.so
-rwxr-xr-x    1 root     root        402087 Nov 11 16:12 /lib/libc.so
root@OpenWrt:~#

comment:10 follow-up: Changed 2 years ago by champetier.etienne@…

hi all,
please test trunk after r47669

comment:11 in reply to: ↑ 10 Changed 2 years ago by anonymous

Replying to champetier.etienne@…:

hi all,
please test trunk after r47669

jailed dnsmasq finally seems to start/run fine on trunk:

root@OpenWrt:~# logread |fgrep dnsm
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: started, version 2.75 cachesize 1000
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack ipset no-auth no-DNSSEC loop-detect inotify
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.100.66 -- 192.168.103.253, lease time 12h
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: using local addresses only for domain lan
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.auto
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: using local addresses only for domain lan
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: using nameserver 10.0.3.1#53
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: using nameserver 10.0.3.1#53
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: read /etc/hosts - 1 addresses
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp - 1 addresses
Mon Nov 30 03:12:55 2015 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
root@OpenWrt:~# uname -a
Linux OpenWrt 3.18.23 #1 SMP Mon Nov 30 02:24:30 EET 2015 i686 n
root@OpenWrt:~# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='Bleeding Edge'
DISTRIB_REVISION='r47670'
DISTRIB_CODENAME='designated_driver'
DISTRIB_TARGET='x86/kvm_guest'
DISTRIB_DESCRIPTION='OpenWrt Designated Driver r47670'
DISTRIB_TAINTS=''
root@OpenWrt:~#

However, both /tmp/.jail/dnsmasq/ and /tmp/dnsmasq.d/ directories seem empty (I'm not sure if this is correct or not):

root@OpenWrt:~# ls -la /tmp/.jail/dnsmasq/
drwxr-xr-x    2 root     root            40 Nov 30 03:12 .
drwxr-xr-x    3 root     root            60 Nov 30 03:12 ..
root@OpenWrt:~# ls -la /tmp/dnsmasq.d/
drwxr-xr-x    2 root     root            40 Nov 30 03:12 .
drwxrwxrwt   15 root     root           380 Nov 30 03:13 ..
root@OpenWrt:~# ls -la /tmp/etc/dnsmasq.conf
-rw-r--r--    1 root     root           503 Nov 30 03:13 /tmp/etc/dnsmasq.conf
root@OpenWrt:~#
root@OpenWrt:~# ls -la /tmp
drwxrwxrwt   15 root     root           380 Nov 30 03:13 .
drwxr-xr-x   17 root     root          4096 Nov 30 03:12 ..
drwxr-xr-x    3 root     root            60 Nov 30 03:12 .jail
drwx------    2 root     root            40 Nov 30 03:12 .uci
-rw-r--r--    1 root     root            29 Nov 30 03:12 TZ
-rw-r--r--    1 root     root             0 Nov 30 03:13 dhcp.leases
drwxr-xr-x    2 root     root            40 Nov 30 03:12 dnsmasq.d
drwxr-xr-x    2 root     root            40 Nov 30 03:12 empty
drwxr-xr-x    2 root     root            60 Nov 30 03:12 etc
drwxr-xr-x    2 root     root            60 Nov 30 03:12 hosts
drwxr-xr-x    3 root     root            60 Nov 30 03:12 lib
drwxrwxrwx    2 root     root            40 Nov 30 03:12 lock
drwxr-xr-x    3 root     root           100 Nov 30 03:12 log
-rw-r--r--    1 root     root            32 Nov 30 03:13 resolv.conf
-rw-r--r--    1 root     root           109 Nov 30 03:12 resolv.conf.auto
drwxrwxrwx    4 root     root           500 Nov 30 03:15 run
drwxrwxrwt    2 root     root            40 Nov 30 03:12 shm
drwxrwxrwx    2 root     root            60 Nov 30 03:12 state
drwxr-xr-x    2 root     root            40 Nov 30 03:12 tmp
root@OpenWrt:~#
root@OpenWrt:~# find /tmp -name dnsm\* -print
/tmp/dnsmasq.d
/tmp/etc/dnsmasq.conf
/tmp/.jail/dnsmasq
/tmp/run/dnsmasq.eth0.dhcp
/tmp/run/dnsmasq
/tmp/run/dnsmasq/dnsmasq.pid
root@OpenWrt:~#

Thank you Etienne for solving the issue and please let me know if you need any nire detailed feedback.

comment:12 Changed 2 years ago by champetier.etienne@…

Hi,

/tmp/.jail/.... is where jail root file system is created. I ve sent another series of patches to remove it (not really needed)

/tmp/dnsmasq.d is dnsmasq specific (and i haven't looked what it's used for)

This can be closed

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.