页次: 1
udhcpc就是这样的,执行前要执行 ifconfig eth0 up,
可能用别的dhcpc解决了这个问题。
etc/init.d/S40network文件内容如下:
我在前面加上ifconfig eth0 up试试。
#!/bin/sh
#
# Start the network....
#
# Debian ifupdown needs the /run/network lock directory
mkdir -p /run/network
case "$1" in
start)
printf "Starting network: "
/sbin/ifup -a
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping network: "
/sbin/ifdown -a
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
Starting system message bus: done
Starting network: [ 9.619955] libphy: 4500000.eth: probed
[ 9.624487] sunxi-gmac 4500000.eth eth0: eth0: Type(8) PHY ID 001cc916 at 0 I RQ poll (4500000.eth-0:00)
udhcpc: started, v1.29.3
udhcpc: sending discover
udhcpc: sending discover
[ 13.867272] sunxi-gmac 4500000.eth eth0: Link is Up - 1Gbps/Full - flow contr ol off
[ 13.875847] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 14.116790] random: crng init done
[ 14.120593] random: 7 urandom warning(s) missed due to ratelimiting
udhcpc: sending discover
udhcpc: no lease, failing
无法获取ipv4, 但是有ipv6.
好像是udhcpc运行时网口还没完全启动,这该怎么办?
#! /bin/bash
echo "Clean buff/cache start..."
free -h
cd /proc/sys/vm
echo 1 > drop_caches
echo 2 > drop_caches
echo 3 > drop_caches
echo "Clean buff/cache end..."
free -h
非常感谢,现在可以是这样,
total used free shared buffers cached
Mem: 107104 30992 76112 76 1220 5640
-/+ buffers/cache: 24132 82972
Swap: 0 0 0
busybox的 free 命令输出格式和标准linux下的格式不太一样,把我搞晕了。
现在明白了,可用内存应该是free+cached 两者之和。
应用程序可以跑起来,我担心空闲内存太小会出现问题,现在看来应该没有问题。
什么应用都没有距,用free查看内存,只剩下25M,感觉捉襟见肘。
有没有方面能调整系统占用的内存?
free命令:
total used free shared buffers cached
Mem: 107104 81244 25860 76 3200 52968
-/+ buffers/cache: 25076 82028
Swap: 0 0 0
ps命令:
PID USER COMMAND
1 root init
2 root [kthreadd]
3 root [rcu_gp]
4 root [rcu_par_gp]
7 root [kworker/u4:0-ev]
8 root [mm_percpu_wq]
9 root [ksoftirqd/0]
10 root [rcu_preempt]
11 root [migration/0]
12 root [cpuhp/0]
13 root [cpuhp/1]
14 root [migration/1]
15 root [ksoftirqd/1]
16 root [kworker/1:0-eve]
18 root [kdevtmpfs]
19 root [kworker/u4:1-ev]
21 root [rcu_tasks_kthre]
33 root [kworker/0:1-eve]
568 root [oom_reaper]
569 root [writeback]
603 root [kblockd]
744 root [ion_system_heap]
767 root [watchdogd]
862 root [cfg80211]
865 root [kswapd0]
971 root [vsync proc 0]
972 root [vsync proc 1]
1075 root [uas]
1118 root [kworker/0:2-rcu]
1141 root [rc0]
1164 root [irq/38-mmc2]
1169 root [irq/39-mmc0]
1213 root [ipv6_addrconf]
1221 root [krfcommd]
1224 root [printk]
1246 root [irq/163-3-003d]
1276 root [goodix_wq]
1289 root [mmc_complete]
1293 root [kworker/1:1H-kb]
1294 root [kworker/0:1H-kb]
1305 root [kworker/1:2H]
1306 root [jbd2/mmcblk0p5-]
1307 root [ext4-rsv-conver]
1313 root [kworker/0:2H]
1325 root /sbin/syslogd -n
1329 root /sbin/klogd -n
1347 root dbus-daemon --system
1371 root [irq/172-usb_id]
1376 root /usr/sbin/dropbear -R
1387 root /usr/sbin/telnetd -F
1393 root /usr/sbin/tftpd -c -l -s /var/lib/tftpboot
1439 root -sh
2465 root [kworker/1:1-eve]
2467 root [kworker/1:2-eve]
2468 root ps
页次: 1