2010-06-25 10:18:09     ftpd

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-06-25 10:18:09     ftpd

Filip Vanalme (BELGIUM)

Message: 90638   

 

Hi,

 

In my project, I need to make a 'default' kernel (or maybe better : a 'rescue' kernel). It will be used when the 'normal' kernel would not startup e.g. when something goes wrong when upgrading the software. It should be as minimal as possible. In that 'rescue' kernel, I would like to enable ftpd so that I can transfer files to the board when in rescue mode. Therefore, I enabled the network :

Network options :

- Packet socket

- Unix domain sockets

- TCP/IP networking

- INET : socket monitoring interface

Network Applications :

- ifconfig

- ftpd

 

When the 'rescue' kernel starts, I can configure my network with ifconfig and I can start ftpd (no errors when starting ftpd). A ping from a remote pc succeeds. However, a ftp session from the pc fails with 'connection refused'.

 

Do I miss something to make ftpd work ?

TranslateQuoteReplyEditDelete

 

 

2010-06-25 10:31:41     Re: ftpd

Filip Vanalme (BELGIUM)

Message: 90639   

 

I added ps functionality to check the running processes and I see that ftpd is not running. so there's obviously something wrong when starting ftpd. Although it's not complaining at startup, it's probably missing something it relies on.

TranslateQuoteReplyEditDelete

 

 

2010-06-25 11:39:30     Re: ftpd

Mike Frysinger (UNITED STATES)

Message: 90640   

 

you didnt say exactly how you ran ftpd

 

run it through strace, or use any of the documented flags:

man user/ftpd/ftpd.8

QuoteReplyEditDelete

 

 

2010-06-28 07:58:23     Re: ftpd

Filip Vanalme (BELGIUM)

Message: 90678   

 

This is strace output when starting ftpd :

 

root:/> strace ftpd

execve(NULL, [0x6dffeb8], [/* 0 vars */] <unfinished ...>

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6da3000

stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=274, ...}) = 0

open("/etc/ld.so.cache", O_RDONLY)      = 3

mmap2(NULL, 274, PROT_READ, MAP_PRIVATE, 3, 0) = 0x6db2000

close(3)                                = 0

open("/lib/libcrypt.so.0", O_RDONLY)    = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=9540, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6db3000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\224\6\0\0004\0\0\0\354"..., 4096) = 4096

mmap2(NULL, 8412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x6810000

mmap2(NULL, 70988, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6840000

pread(3, "D\352\276\244\251\317\336K`K\273\366p\274\277\276\306~\233(\372'\241\352\2050\357\324\5\35\210\0049"..., 644, 8192) = 644

close(3)                                = 0

munmap(0x6db3000, 4096)                 = 0

open("/lib/libgcc_s.so.1", O_RDONLY)    = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=52120, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6db3000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\364\"\0\0004\0\0\0\330"..., 4096) = 4096

mmap2(NULL, 48168, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x6860000

mmap2(NULL, 6080, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6814000

pread(3, "\200\f\375\37j2n\230\2`\3`'\341\177\0\0\0i\230\17T\220@\201\f\303V:d\371\37\3"..., 5920, 45056) = 5920

close(3)                                = 0

munmap(0x6db3000, 4096)                 = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=239992, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6db3000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0(\275\0\0004\0\0\0\270"..., 4096) = 4096

mmap2(NULL, 232444, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x6880000

mmap2(NULL, 17568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x6818000

pread(3, " %d str %d auth %d\n\0svc_run: - po"..., 9052, 229376) = 9052

close(3)                                = 0

munmap(0x6db3000, 4096)                 = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=239992, ...}) = 0

close(3)                                = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=239992, ...}) = 0

close(3)                                = 0

munmap(0x6db2000, 274)                  = 0

stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=30360, ...}) = 0

ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0

time(NULL)                              = 1167609680

socket(PF_FILE, SOCK_DGRAM, 0)          = 3

fcntl(3, F_SETFD, FD_CLOEXEC)           = 0

fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)

fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

socket(PF_FILE, SOCK_STREAM, 0)         = 3

fcntl(3, F_SETFD, FD_CLOEXEC)           = 0

fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)

fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

close(2)                                = 0

open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 2

ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x683fc90) = -1 ENOTTY (Inappropriate ioctl for device)

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x6db3000

getpeername(0, 0x6db7e24, [16])         = -1 ENOTSOCK (Socket operation on non-socket)

rt_sigaction(SIGPIPE, {0x6819708, [], 0}, {SIG_DFL, [], 0}, 8) = 0

socket(PF_FILE, SOCK_DGRAM, 0)          = 3

fcntl(3, F_SETFD, FD_CLOEXEC)           = 0

fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)

fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

socket(PF_FILE, SOCK_STREAM, 0)         = 3

fcntl(3, F_SETFD, FD_CLOEXEC)           = 0

fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)

fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 16) = -1 ENOENT (No such file or directory)

close(3)                                = 0

time([1167609681])                      = 1167609681

getpid()                                = 29

rt_sigaction(SIGPIPE, {SIG_DFL, [], 0}, NULL, 8) = 0

_exit(1)                                = ?

 

As far as I can see, the problem could be the missing /dev/log. Correct ? I'm not a very experienced Linux user : has this something to do with syslog ? What is creating that 'device' in /dev ?

TranslateQuoteReplyEditDelete

 

 

2010-06-28 10:07:20     Re: ftpd

Filip Vanalme (BELGIUM)

Message: 90685   

 

Ok, problem solved. Inetd was not included and not running.

Attachments

    Outcomes