Weird /dev/null problem (Was: SSH Daemon failing)
Hi All.
After using strace -f to follow the child processes, it appears that once it
forks, it attempts to access /dev/null (strace output at bottom), then reads
the time, opens /dev/log and sends the following line
Feb 26 10:19:06 porky sshd[295]: fatal: daemon() failed: Success
It appears to be failing when it tries to access /dev/null. And after a
closer look, so are a few other services (this server isn't live yet, and I
was mainly concerned with SSH).
porky:/var/log# /etc/init.d/postgresql start
/usr/lib/postgresql/bin/postgresql-startup: /dev/null: Permission denied
porky:/dev# ls -al null
-rwxr-xr-x 1 root root 0 Feb 26 10:16 null
Those permissions are just plain wrong, It should be:
crw-rw-rw- 1 root root 1, 3 Dec 1 2000 null
I have managed to change it to:
-rw-rw-rw- 1 root root 1, 3 Dec 1 2000 null
However I am still missing the "c", and SSH still isn't working (although
postgresql does now).
How do I fix the permissions properly?
Andrew Tait
System Administrator
Country NetLink Pty, Ltd
E-Mail: andrewt@cnl.com.au
WWW: http://www.cnl.com.au
30 Bank St Cobram, VIC 3644, Australia
Ph: +61 (03) 58 711 000
Fax: +61 (03) 58 711 874
"It's the smell! If there is such a thing." Agent Smith - The Matrix
fork() = 1875
[pid 1874] _exit(0) = ?
setsid() = 1875
chdir("/") = 0
open("/dev/null", O_RDWR) = 3
fstat64(3, {st_dev=makedev(3, 1), st_ino=3549, st_mode=S_IFREG|0755,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=0,
st_atime=2002/02/26-06:25:54, st_mtime=2002/02/26-09:07:18,
st_ctime=2002/02/26-09:07:18}) = 0
close(3) = 0
brk(0x8091000) = 0x8091000
time([1014678180]) = 1014678180
open("/etc/localtime", O_RDONLY) = 3
fstat64(3, {st_dev=makedev(3, 1), st_ino=83017, st_mode=S_IFREG|0644,
st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=785,
st_atime=2002/02/26-10:03:00, st_mtime=2002/02/04-18:02:18,
st_ctime=2002/02/11-12:23:34}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40016000
read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0"..., 4096) =
785
close(3) = 0
munmap(0x40016000, 4096) = 0
getpid() = 1875
rt_sigaction(SIGPIPE, {0x401e8fa8, [], 0x4000000}, {SIG_DFL}, 8) = 0
socket(PF_UNIX, SOCK_DGRAM, 0) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sin_family=AF_UNIX, path="/dev/log"}, 16) = 0
send(3, "<34>Feb 26 10:03:00 sshd[1875]: "..., 63, 0) = 63
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
close(3) = 0
_exit(255) = ?
Reply to: