我已经将此服务添加到启动项中systemctl enable netcfg
,
这是 的内容/etc/conf.d/network
,
NETWORKS=(eth0 eth1)
WIRED_INTERFACE="eth0"
WIRELESS_INTERFACE="wlan0"
AUTO_PROFILES=(eth0 eth1)
netcfg.service 的内容:
[root@localhost ~]# cat /etc/systemd/system/multi-user.target.wants/netcfg.service
[Unit]
Description=Netcfg multi-profile daemon
Before=network.target
Wants=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/netcfg-daemon start
ExecStop=/usr/bin/netcfg-daemon stop
KillMode=none
[Install]
WantedBy=multi-user.target
netcfg 的journalctl 日志:
Oct 29 XXXXXX localhost netcfg-daemon[182]: No recorded netcfg state to restore
Oct 29 XXXXXX localhost systemd[1]: netcfg.service: main process exited, code=exited, status=1/FAILURE
Oct 29 XXXXXX localhost systemd[1]: Failed to start Netcfg multi-profile daemon.
Oct 29 XXXXXX localhost systemd[1]: Unit netcfg.service entered failed state
它不起作用(随机工作?),输出显示netcfg
失败,但手动调用它可以工作,为什么?
答案1
netcfg
已弃用。升级到netctl
并重试。