[Bug 278195] daemon in jail is exiting without informing that it failed to execute
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 08 Apr 2024 06:51:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278195 --- Comment #3 from Zhenlei Huang <zlei@FreeBSD.org> --- Another truss(1) that show what happens when the `--close-fds` option is supplied. ``` # truss -f /tmp/daemon -fSl daemon echo OK ... 955: connect(3,{ AF_UNIX "/var/run/logpriv" },106) = 0 (0x0) 955: open("/dev/null",O_RDWR,00) = 4 (0x4) 955: sigaction(SIGHUP,{ SIG_IGN 0x0 ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0) 956: <new process> 955: fork() = 956 (0x3bc) 956: setsid() = 956 (0x3bc) 956: sigaction(SIGHUP,{ SIG_IGN SA_RESTART ss_t },0x0) = 0 (0x0) 956: dup2(4,0) = 0 (0x0) 956: dup2(4,1) = 1 (0x1) 956: dup2(4,2) = 2 (0x2) 956: close(4) = 0 (0x0) 956: madvise(0x0,0,MADV_PROTECT) = 0 (0x0) 956: pipe2(0x7fffffffe950,0) = 0 (0x0) 956: write(2,"ld-elf.so.1: ",13) = 13 (0xd) 956: write(2,"/tmp/daemon: Undefined symbol "k"...,48) = 48 (0x30) 956: write(2,"\n",1) = 1 (0x1) 956: exit(0x1) 956: process exit, rval = 1 955: exit(0x0) 955: process exit, rval = 0 ``` So simply put, when `--close-fds` option is present, daemon(3) closes fd 0,1,2 and these fds are redirected to /dev/null but logfile or syslog is opened too late to catch error messages. -- You are receiving this mail because: You are the assignee for the bug.