1
imn1 2015-08-13 13:30:33 +08:00
本来想回复让你自己按摩一下的,进来居然看到标题改了~
dhcp比dnsmasq还慢? |
2
whatot 2015-08-13 13:40:44 +08:00
After=network.target
我的dnsmasq.service有这么一条,不知道你的为什么是这样?? |
3
whatot 2015-08-13 13:43:33 +08:00
添加一个依赖,应该就行了
|
7
Starduster 2015-08-13 15:31:27 +08:00
写个脚本在开机之后 xx 秒再一遍跑 dnsmasq
|
8
realpg 2015-08-13 21:40:39 +08:00
改一下dnsmasq的init.d脚本 增加检测wlan0的IP 如果检测不到就sleep5
|
10
station OP @Starduster 总觉得这不是根本解决之道,肯定那里出问题了,亦或是bug ?
|
13
whatot 2015-08-14 11:38:54 +08:00
@station 因为我用的是桌面系统,所以使用的是NetworkManager,NetworkManager管理了这一系列的启动,跟你的有点区别。但肯定的是dnsmasq启动太早了。
$ systemctl status NetworkManager.service ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled) Active: active (running) since 五 2015-08-14 10:08:48 CST; 1h 27min ago Main PID: 555 (NetworkManager) CGroup: /system.slice/NetworkManager.service ├─ 555 /usr/bin/NetworkManager --no-daemon ├─2143 /usr/bin/dhclient -d -q -sf /usr/lib/networkmanager/nm-dhcp-helper -pf /var/run/dhclient-wlp3s0.pid -lf /var/lib/NetworkManager/dhclient-c7a9c963-908b-4cf4-91fe-81a2c810... └─2151 /usr/bin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var... |
14
station OP @whatot 的确,好多after=network.target都比network启动早,我还找不到原因,实在不行只能重做系统了......
|
15
HMSQQbA 2015-08-14 12:53:13 +08:00 via Android
systemd真是蛋痛的玩意,常出此类问题。
|
17
HMSQQbA 2015-08-14 14:23:00 +08:00 via Android
@station 不是你这个问题,但常遇到各种unit不能按规则触发。对systemd总体感觉不好。
|
18
rwzsycwan 2015-08-15 00:29:59 +08:00
debian 8 的dnsmasq.service:
[Unit] Description=dnsmasq - A lightweight DHCP and caching DNS server Requires=network.target [Service] Type=forking PIDFile=/var/run/dnsmasq/dnsmasq.pid # Test the config file and refuse starting if it is not valid. ExecStartPre=/usr/sbin/dnsmasq --test # We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a # wrapper picking up extra configuration files and then execs dnsmasq # itself, when called with the "systemd-exec" function. ExecStart=/etc/init.d/dnsmasq systemd-exec # The systemd-*-resolvconf functions configure (and deconfigure) # resolvconf to work with the dnsmasq DNS server. They're called liek # this to get correct error handling (ie don't start-resolvconf if the # dnsmasq daemon fails to start. ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target |