기존 이솝 임베디드 포럼의 지식인 서비스가 게시판 형태로 변경되었습니다.

오드로이드 T로 작업 중입니다.


커널을 조금 수정하여 cdc ethernet usb 지원하게 했는데요..


한가지 문제가 dhcp 서버가 내장된 디바이스를 오드로이드에 usb로 연결하게 되면


eth0 가 올라오긴 합니다만, dhcpcd를 adb shell에서 직접 쳐서 ip를 받아야만 하는 문제가 생기네요..


램디스크를 수정하여 dhcpcd -d eth0 부분의 주석을 풀면 dhcpcd 가 지속적으로 실행이되면서 usb를 통해 dhcp 서버가 내장


된 디바이스를 오드로이드에 꽂게 되면 ip를 자동으로 받아오긴 합니다만, 문제는 계속적으로 돌아가면서 ps로 확인하면


dhcpcd 프로세스가 일정시간 간격으로 계속 증가합니다.


그리고 나중에는 엄청 많아져서 안드로이드가 느려지는 현상이 발생하고요..


알고 싶은 건요. usb를 딱 꽂았을 때 eth0가 올라온후에 "dhcpcd eth0" 명령어가 실행되게끔 할려고 하는데.. 이거 가능한가요?


고수님들의 따뜻한 조언 부탁드립니다.




고등어

2011.02.16 00:30:25
*.111.41.24

가능합니다.

그런데 리눅스 안한지 오래되서 기억이 안납니다. ^^;

지금 리눅스하시는 분은 알텐데요.


이제현

2011.02.16 01:24:55
*.90.137.102

USB gadget으로 ethernet만 붙이고 고정 IP 쓸때는 아무런 문제가 없는지요?

dhcpd 데몬이 돌면서 계속 프로세스가 증가하는 것이 문제의 핵심인가요?

뱉어팬

2011.02.16 01:52:46
*.55.81.122

init.rc 에서

service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d eth0 <- 이부분이 원래 주석 처리되어 있던 건데 풀었습니다.
service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d wlan0
        disabled
        oneshot
        group system dhcp

그러면 usb 에 dhcp 서버 내장 디바이스를 연결시에 
아래처럼 ip를 받아오긴 합니다만,
# netcfg
lo       UP    127.0.0.1       255.0.0.0       0x00000049
eth0     UP    192.168.33.2    255.255.255.0   0x00001043

문제는 ps를 잠시후 확인하면

app_11    2245  2005  207544 19644 ffffffff afd0ebb8 S com.android.bluetooth
app_12    2254  2005  207480 20028 ffffffff afd0ebb8 S com.android.deskclock
app_26    2265  2005  211324 21036 ffffffff afd0ebb8 S com.android.email
app_29    2276  2005  220856 20632 ffffffff afd0ebb8 S com.android.mms
app_31    2298  2005  208500 19788 ffffffff afd0ebb8 S com.android.providers.calendar
app_37    2310  2005  206628 18580 ffffffff afd0ebb8 S com.rechild.advancedtaskkillerpro
app_7     2318  2005  209536 19720 ffffffff afd0ebb8 S com.android.quicksearchbox
app_10    2326  2005  208024 19292 ffffffff afd0ebb8 S com.android.music
app_19    2333  2005  206740 18744 ffffffff afd0ebb8 S com.android.protips
app_14    2342  2005  209324 20400 ffffffff afd0ebb8 S com.cooliris.media
root      2396  2011  632    312   c00655bc afd0e86c S /system/bin/sh
root      2397  2396  1412   1120  c00fa67c afd0dcf4 S logcat
dhcp      2781  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2814  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2851  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2888  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2925  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2962  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      2999  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3036  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3073  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3110  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3148  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3185  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3222  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3259  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3296  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3335  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3372  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3410  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3449  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3486  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3525  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3564  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3601  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3639  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3679  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3716  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3757  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3795  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3835  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3872  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3911  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3949  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      3986  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      4023  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      4060  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd
dhcp      4099  1     744    332   c00fa67c afd0ea3c S /system/bin/dhcpcd


dhcpcd 가 엄청나게 증가했고요, 디바이스를 빼지않는한, 없어지지 않고 계속 증가합니다.

이클립스를 통해 본 로그는 다음과 같습니다.

02-05 04:10:27.272: DEBUG/dhcpcd(5186): sending ARP announce (2 of 2)
02-05 04:10:27.276: DEBUG/dhcpcd(5186): renew in 43196 seconds
02-05 04:10:30.190: ERROR/dhcpcd(5193): flock `/data/misc/dhcp/dhcpcd-eth0.pid': Try again
02-05 04:10:30.190: INFO/logwrapper(5191): /system/bin/dhcpcd terminated by exit(1)
02-05 04:10:35.190: DEBUG/dhcpcd(5201): dhcpcd 4.0.15 starting
02-05 04:10:35.190: DEBUG/dhcpcd(5201): hardware address = 30:38:55:44:95:40
02-05 04:10:35.190: DEBUG/dhcpcd(5201): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason PREINIT
02-05 04:10:35.222: DEBUG/dhcpcd(5201): host does not support a monotonic clock - timing can skew
02-05 04:10:35.222: DEBUG/dhcpcd(5201): broadcasting for a lease
02-05 04:10:35.222: DEBUG/dhcpcd(5201): sending DHCP_DISCOVER with xid 0xe987dc0c, next in 4.59 seconds
02-05 04:10:35.222: DEBUG/dhcpcd(5201): offered 192.168.33.2 from 192.168.33.1
02-05 04:10:35.222: DEBUG/dhcpcd(5201): sending DHCP_REQUEST with xid 0xe987dc0c, next in 3.15 seconds
02-05 04:10:35.222: DEBUG/dhcpcd(5201): acknowledged 192.168.33.2 from 192.168.33.1
02-05 04:10:35.222: DEBUG/dhcpcd(5201): leased 192.168.33.2 for 86400 seconds
02-05 04:10:35.222: DEBUG/dhcpcd(5201): adding IP address 192.168.33.2/24
02-05 04:10:35.225: DEBUG/dhcpcd(5201): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason BOUND
02-05 04:10:35.272: DEBUG/dhcpcd(5201): forking to background
02-05 04:10:35.272: INFO/logwrapper(5199): /system/bin/dhcpcd terminated by exit(0)
02-05 04:10:35.272: DEBUG/dhcpcd(5224): sending ARP announce (1 of 2), next in 2.00 seconds
02-05 04:10:37.278: DEBUG/dhcpcd(5224): sending ARP announce (2 of 2)
02-05 04:10:37.278: DEBUG/dhcpcd(5224): renew in 43196 seconds
02-05 04:10:40.222: ERROR/dhcpcd(5231): flock `/data/misc/dhcp/dhcpcd-eth0.pid': Try again
02-05 04:10:40.225: INFO/logwrapper(5229): /system/bin/dhcpcd terminated by exit(1)
02-05 04:10:45.198: DEBUG/dhcpcd(5239): dhcpcd 4.0.15 starting
02-05 04:10:45.198: DEBUG/dhcpcd(5239): hardware address = 30:38:55:44:95:40
02-05 04:10:45.198: DEBUG/dhcpcd(5239): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason PREINIT
02-05 04:10:45.225: DEBUG/dhcpcd(5239): host does not support a monotonic clock - timing can skew
02-05 04:10:45.225: DEBUG/dhcpcd(5239): broadcasting for a lease
02-05 04:10:45.225: DEBUG/dhcpcd(5239): sending DHCP_DISCOVER with xid 0xe022d524, next in 3.97 seconds
02-05 04:10:45.225: DEBUG/dhcpcd(5239): offered 192.168.33.2 from 192.168.33.1
02-05 04:10:45.225: DEBUG/dhcpcd(5239): sending DHCP_REQUEST with xid 0xe022d524, next in 3.17 seconds
02-05 04:10:45.225: DEBUG/dhcpcd(5239): acknowledged 192.168.33.2 from 192.168.33.1
02-05 04:10:45.225: DEBUG/dhcpcd(5239): leased 192.168.33.2 for 86400 seconds
02-05 04:10:45.225: DEBUG/dhcpcd(5239): adding IP address 192.168.33.2/24
02-05 04:10:45.225: DEBUG/dhcpcd(5239): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason BOUND
02-05 04:10:45.272: DEBUG/dhcpcd(5239): forking to background
02-05 04:10:45.272: INFO/logwrapper(5237): /system/bin/dhcpcd terminated by exit(0)
02-05 04:10:45.276: DEBUG/dhcpcd(5262): sending ARP announce (1 of 2), next in 2.00 seconds
02-05 04:10:47.280: DEBUG/dhcpcd(5262): sending ARP announce (2 of 2)
02-05 04:10:47.280: DEBUG/dhcpcd(5262): renew in 43196 seconds
02-05 04:10:50.198: ERROR/dhcpcd(5269): flock `/data/misc/dhcp/dhcpcd-eth0.pid': Try again
02-05 04:10:50.198: INFO/logwrapper(5267): /system/bin/dhcpcd terminated by exit(1)
02-05 04:10:55.229: DEBUG/dhcpcd(5276): dhcpcd 4.0.15 starting
02-05 04:10:55.229: DEBUG/dhcpcd(5276): hardware address = 30:38:55:44:95:40
02-05 04:10:55.229: DEBUG/dhcpcd(5276): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason PREINIT
02-05 04:10:55.264: DEBUG/dhcpcd(5276): host does not support a monotonic clock - timing can skew
02-05 04:10:55.264: DEBUG/dhcpcd(5276): broadcasting for a lease
02-05 04:10:55.264: DEBUG/dhcpcd(5276): sending DHCP_DISCOVER with xid 0x4f1508bb, next in 4.30 seconds
02-05 04:10:55.264: DEBUG/dhcpcd(5276): offered 192.168.33.2 from 192.168.33.1
02-05 04:10:55.264: DEBUG/dhcpcd(5276): sending DHCP_REQUEST with xid 0x4f1508bb, next in 4.93 seconds
02-05 04:10:55.264: DEBUG/dhcpcd(5276): acknowledged 192.168.33.2 from 192.168.33.1
02-05 04:10:55.264: DEBUG/dhcpcd(5276): leased 192.168.33.2 for 86400 seconds
02-05 04:10:55.264: DEBUG/dhcpcd(5276): adding IP address 192.168.33.2/24
02-05 04:10:55.264: DEBUG/dhcpcd(5276): executing `/system/etc/dhcpcd/dhcpcd-run-hooks', reason BOUND
02-05 04:10:55.311: DEBUG/dhcpcd(5276): forking to background
02-05 04:10:55.315: INFO/logwrapper(5274): /system/bin/dhcpcd terminated by exit(0)
02-05 04:10:55.315: DEBUG/dhcpcd(5299): sending ARP announce (1 of 2), next in 2.00 seconds
02-05 04:10:57.319: DEBUG/dhcpcd(5299): sending ARP announce (2 of 2)
02-05 04:10:57.319: DEBUG/dhcpcd(5299): renew in 43196 seconds
02-05 04:11:00.198: ERROR/dhcpcd(5306): flock `/data/misc/dhcp/dhcpcd-eth0.pid': Try again

계속적으로 dhcpcd가 반복 실행이 되는 것 같은데 맞나요? 

init.rc에서 수정을 해야할까요? 아니면, udev hotplug 스크립트를 만들어야 할까요? (udev쪽 스크립트는 잘 모릅니다. ㅜㅜ)

알려주세요..~ 

List of Articles
번호 제목 글쓴이 날짜 조회 수
» usb ethernet 꽂으면 자동으로 dhcpcd 실행하고 싶은데요. [3] 뱉어팬 2011-02-15 1583

사용자 로그인