2010-11-19 03:59:48     Running FTPD as a standalone program

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

2010-11-19 03:59:48     Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 95988   

 

Hello,

 

I have modified my romfs/etc/inetd.conf file to not start ftpd though inetd process once kernel boots.  Now, when I run ftpd manually using "ftpd -D" command ftp server is not started(-D option to run as standalone process).

 

Could any one help me on this?

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-19 05:21:23     Re: Running FTPD as a standalone program

Mike Frysinger (UNITED STATES)

Message: 95996   

 

what ftpd are you using exactly ?  there are a couple in the uclinux-dist.

QuoteReplyEditDelete

 

 

2010-11-19 05:31:57     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 95997   

 

Hello Mike,

 

I have enabled NetworkApplications/ftpd, I think it uses user/ftpd code.

 

Regards,                                                                                                                                                                                                                                                    

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-19 05:43:53     Re: Running FTPD as a standalone program

Mike Frysinger (UNITED STATES)

Message: 95999   

 

you'll have to enable HAVE_DAEMON in user/ftpd/config.h

 

although i dont know why you'd stop using inetd ... the entire point of it is to avoid multiple servers being resident all the time

QuoteReplyEditDelete

 

 

2010-11-19 05:56:41     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 96003   

 

Hello Mike,

 

/* Define to one if you have 'daemon' function */

#ifdef __uClinux__

#undef HAVE_DAEMON

#else

#define HAVE_DAEMON 1

#endif

 

 

Do I need to change this file manually, define HAVE_DAEMON to 1 in case of ifdef __uClinux__ or Is there any other way to change this?

 

I am stopping ftpd though inetd because I have to start ftpd from my application.

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-19 07:39:57     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 96007   

 

Hello Mike,

 

After enabling HAVE_DAEMON to 1 I am getting the following error messages in log file

 

Jan 15 02:58:25 blackfin ftp.err ftpd[176]: [truncated] m

Jan 15 02:58:29 blackfin ftp.err ftpd[178]: failed to become a daemon

 

Regards

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-19 17:21:58     Re: Running FTPD as a standalone program

Mike Frysinger (UNITED STATES)

Message: 96017   

 

you need to recompile things

QuoteReplyEditDelete

 

 

2010-11-22 05:16:02     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 96087   

 

Hello Mike,

 

Cleaning & compiling the new Image made "ftpd -D -d" to run as a standalone process. Now, I am able to connect to uClinux ftp server & can run ftp commands. But once I quit the session following error message is logged

 

Jan  6 10:09:34 blackfin user.notice kernel: Illegal use of supervisor resource

Jan  6 10:09:34 blackfin user.notice kernel: <5> - Attempted to use a Supervisor register or instruction from User mode.

Jan  6 10:09:34 blackfin user.notice kernel: <5>   Supervisor resources are registers and instructions that are reserved

Jan  6 10:09:34 blackfin user.notice kernel: <5>   for Supervisor use: Supervisor only registers, all MMRs, and Supervisor

Jan  6 10:09:34 blackfin user.notice kernel: <5>   only instructions.

Jan  6 10:09:34 blackfin user.notice kernel: Deferred Exception context

Jan  6 10:09:34 blackfin user.notice kernel: CURRENT PROCESS:

Jan  6 10:09:34 blackfin user.notice kernel: COMM=ftpd PID=177  CPU=0

Jan  6 10:09:34 blackfin user.notice kernel: TEXT = 0x02e00000-0x02e0aec4        DATA = 0x02ddcec4-0x02dde43c

Jan  6 10:09:34 blackfin user.notice kernel:  BSS = 0x02dde43c-0x02e20000  USER-STACK = 0x02e3fea0

Jan  6 10:09:34 blackfin user.notice kernel: return address: [0x02e02490]; contents of:

Jan  6 10:09:34 blackfin user.notice kernel: SEQUENCER STATUS:          Not tainted

Jan  6 10:09:34 blackfin user.notice kernel:  SEQSTAT: 0000002e  IPEND: 0008  IMASK: ffff  SYSCFG: 0006

Jan  6 10:09:34 blackfin user.notice kernel:   EXCAUSE   : 0x2e

Jan  6 10:09:34 blackfin user.notice kernel:   physical IVG3 asserted : <0xffa00684> { _trap + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:  RETE: <0x00000000> /* Maybe null pointer? */

Jan  6 10:09:34 blackfin user.notice kernel:  RETN: <0x02e14000> /* kernel dynamic memory */

Jan  6 10:09:34 blackfin user.notice kernel:  RETX: <0x00000480> /* Maybe fixed code section */

Jan  6 10:09:34 blackfin user.notice kernel:  RETS: <0x02e07e68> [ /bin/ftpd + 0x7e68 ]

Jan  6 10:09:34 blackfin user.notice kernel:  PC  : <0x02e02490> [ /bin/ftpd + 0x2490 ]

Jan  6 10:09:34 blackfin user.notice kernel: DCPLB_FAULT_ADDR: <0xffffff38> /* core mmrs */

Jan  6 10:09:34 blackfin user.notice kernel: ICPLB_FAULT_ADDR: <0x02e02490> [ /bin/ftpd + 0x2490 ]

Jan  6 10:09:34 blackfin user.notice kernel: PROCESSOR STATE:

Jan  6 10:09:34 blackfin user.notice kernel:  R0 : 00000000    R1 : 02dde2b0    R2 : 02e3fd8c    R3 : 0000c0dc

Jan  6 10:09:34 blackfin user.notice kernel:  R4 : 00000000    R5 : 02dde2b0    R6 : 02e0a62c    R7 : 02dda29c

Jan  6 10:09:34 blackfin user.notice kernel:  P0 : 000000be    P1 : 029cc0dc    P2 : 02dd83c4    P3 : 00000003

Jan  6 10:09:34 blackfin user.notice kernel:  P4 : 02e3fea4    P5 : 02e19cd0    FP : 02e3fd90    SP : 02e13f24

Jan  6 10:09:34 blackfin user.notice kernel:  LB0: 02b3c5cf    LT0: 02b3c5ce    LC0: 00000000

Jan  6 10:09:34 blackfin user.notice kernel:  LB1: 029dbb43    LT1: 029dbb42    LC1: 00000000

Jan  6 10:09:34 blackfin user.notice kernel:  B0 : 00000137    L0 : 00000000    M0 : fffffffc    I0 : 0000000a

Jan  6 10:09:34 blackfin user.notice kernel:  B1 : 000000c0    L1 : 00000000    M1 : 00000001    I1 : 02e19278

Jan  6 10:09:34 blackfin user.notice kernel:  B2 : 7ffff000    L2 : 00000000    M2 : 00001802    I2 : 00000003

Jan  6 10:09:34 blackfin user.notice kernel:  B3 : 00000000    L3 : 00000000    M3 : 0000005b    I3 : 00000006

Jan  6 10:09:34 blackfin user.notice kernel: A0.w: 00000000   A0.x: 00000000   A1.w: 00000000   A1.x: 00000000

Jan  6 10:09:34 blackfin user.notice kernel: USP : 02e3fd64  ASTAT: 02001044

Jan  6 10:09:34 blackfin user.notice kernel: Hardware Trace:

Jan  6 10:09:34 blackfin user.notice kernel:    0 Target : <0x00003118> { _trap_c + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00616> { _exception_to_level5 + 0x9a } CALL pcrel

Jan  6 10:09:34 blackfin user.notice kernel:    1 Target : <0xffa0057c> { _exception_to_level5 + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00438> { _bfin_return_from_exception + 0x20 } RTX

Jan  6 10:09:34 blackfin user.notice kernel:    2 Target : <0xffa00418> { _bfin_return_from_exception + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa004dc> { _ex_trap_c + 0x74 } JUMP.S

Jan  6 10:09:34 blackfin user.notice kernel:    3 Target : <0xffa00468> { _ex_trap_c + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa006ea> { _trap + 0x66 } JUMP (P4)

Jan  6 10:09:34 blackfin user.notice kernel:    4 Target : <0xffa006a2> { _trap + 0x1e }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa0069e> { _trap + 0x1a } IF CC JUMP pcrel

Jan  6 10:09:34 blackfin user.notice kernel:    5 Target : <0xffa00684> { _trap + 0x0 }

Jan  6 10:09:34 blackfin user.notice kernel:       FAULT : <0x02e02490> [ /bin/ftpd + 0x2490 ] P1 = [P3 + 0x38]

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0x02e07e64> [ /bin/ftpd + 0x7e64 ] CALL pcrel

Jan  6 10:09:34 blackfin user.notice kernel:    6 Target : <0x02e07e60> [ /bin/ftpd + 0x7e60 ]

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0x02e07e82> [ /bin/ftpd + 0x7e82 ] IF !CC JUMP pcrel (BP)

Jan  6 10:09:34 blackfin user.notice kernel:    7 Target : <0x02e07e80> [ /bin/ftpd + 0x7e80 ]

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0x029cc0e2> [ /lib/libc.so.0 + 0xc0e2 ] RTS

Jan  6 10:09:34 blackfin user.notice kernel:    8 Target : <0x029cc0e2> [ /lib/libc.so.0 + 0xc0e2 ]

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00c8c> { __common_int_entry + 0xf0 } RTI

Jan  6 10:09:34 blackfin user.notice kernel:    9 Target : <0xffa00c2a> { __common_int_entry + 0x8e }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00e74> { _evt_system_call + 0x64 } JUMP.S

Jan  6 10:09:34 blackfin user.notice kernel:   10 Target : <0xffa00e74> { _evt_system_call + 0x64 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00876> { _system_call + 0xbe } RTS

Jan  6 10:09:34 blackfin user.notice kernel:   11 Target : <0xffa00872> { _system_call + 0xba }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00862> { _system_call + 0xaa } IF !CC JUMP pcrel

Jan  6 10:09:34 blackfin user.notice kernel:   12 Target : <0xffa00858> { _system_call + 0xa0 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa00848> { _system_call + 0x90 } IF !CC JUMP pcrel

Jan  6 10:09:34 blackfin user.notice kernel:   13 Target : <0xffa00822> { _system_call + 0x6a }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0xffa000f0> { _sys_vfork + 0x10 } RTS

Jan  6 10:09:34 blackfin user.notice kernel:   14 Target : <0xffa000ec> { _sys_vfork + 0xc }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0x0000189c> { _bfin_vfork + 0x1c } RTS

Jan  6 10:09:34 blackfin user.notice kernel:   15 Target : <0x00001898> { _bfin_vfork + 0x18 }

Jan  6 10:09:34 blackfin user.notice kernel:      Source : <0x0000e92c> { _do_fork + 0x68 } RTS

Jan  6 10:09:34 blackfin user.notice kernel: Userspace Stack

Jan  6 10:09:34 blackfin user.notice kernel: Stack info:

Jan  6 10:09:34 blackfin user.notice kernel:  SP: [0x02e3fd64] <0x02e3fd64> [ ftpd + 0x1fd64 ]

Jan  6 10:09:34 blackfin user.notice kernel:  FP: (0x02e3fdc0)

Jan  6 10:09:34 blackfin user.notice kernel:  Memory from 0x02e3fd60 to 02e40000

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fd60: 02dd83c4 [02e3fdc0] 02b3c54c  02dde2b0  02e3fea4  02e1b883  00000003

02ddd374

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fd80: 00000000  02e3fdc0  02e077f2  02dde2b0  02e3fea4  02e1b883  00000003

02ddd374

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fda0: 00000000  02e0a420  02e08544  02dda2b0  02e09ab0  02e09ac0  02ddd7f8

00000001

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fdc0:(02e3fe64)<029f0962> 02e19cd0  02dd86ec  02e3ff9f  02e3ff50  02e3ff70

00000003

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fde0: 00000000  00000000  00000000  00000000  00000000  00000000  00000000

00000000

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fe00: 00000000  00000003  02e00034  00000004  00000020  00000005  00000006

00000006

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fe20: 00001000  00000007  02b38000  00000008  00000000  00000009  02e0280c

00000000

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fe40: 00000000  0000000b  00000000  0000000c  00000000  0000000d  00000000

0000000e

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fe60: 00000000 (00000000) 02e0283a  02dd9be0  02e0280c  02dd9bc8  02e3ff50

02e3ff70

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fe80: 02e02810  02dd86ec  02e3ff50  02e3fea4  02dd86e4  02dd8728  02dd9bc8

02e3ff7c

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fea0: 00000003  02e3ff9f <02e3ffa4> 02e3ffa7  00000000 <02e3ffaa> 02e3ffb5

02e3ffd8

Jan  6 10:09:34 blackfin user.notice kernel: 02e3fec0: 02e3ffec  00000000  00000010  00000000  00000006  00001000  00000011

00000064

Jan  6 10:09:34 blackfin user.notice kernel:     address : <0x02e3ffaa> [ ftpd + 0x1ffaa ]

 

How can I avoid this? I don't see this while running ftpd through inetd.

 

Does this ftpd handles multiple connection simultaneously as a standalone process?

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-22 13:37:33     Re: Running FTPD as a standalone program

Mike Frysinger (UNITED STATES)

Message: 96095   

 

this has been fixed in trunk already.  why dont you just use inetd like normal and there wont be any problems.

QuoteReplyEditDelete

 

 

2010-11-22 23:48:59     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 96108   

 

Hello Mike,

 

OK, I will try with the latest version. My requirement is ftpd should be started by default on reboot, it should be started when my application starts.

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-11-23 02:16:07     Re: Running FTPD as a standalone program

Parimala Baggiri (INDIA)

Message: 96110   

 

Thank you Mike, latest update works fine.

 

Regards,

 

Parimala

Attachments

    Outcomes