使用systemctl时无法启动named


9

我无法在Fedora 18 Raspberry Pi旋转上开始使用systemd命名时遇到麻烦。它开始,然后过一会儿超时,然后失败。如果我手动运行named.service中的命令,则named开始就可以了。我不知道systemctl在寻找什么超时或者在哪里调用它。我已经阅读了systemctl,systemd和其他手册页,并且我将继续进行研究,但是如果有人有任何指点,那就太好了。

systemctl status named.service 输出:

named.service - Berkeley Internet Name Domain (DNS)
          Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
          Active: failed (Result: timeout) since Tue 2013-01-29 14:36:41 EST; 35min ago
         Process: 4189 ExecStart=/usr/sbin/named -u named $OPTIONS (code=exited, status=0/SUCCESS)
         Process: 4186 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=0/SUCCESS)
         Process: 4183 ExecStartPre=/usr/libexec/generate-rndc-key.sh (code=exited, status=0/SUCCESS)

Jan 29 14:35:12 raspi.example.com named[4191]: all zones loaded
Jan 29 14:35:12 raspi.example.com systemd[1]: PID file /run/named/named.pid not readable (yet?) after start.
Jan 29 14:35:12 raspi.example.com named[4191]: running
Jan 29 14:36:41 raspi.example.com systemd[1]: named.service operation timed out. Terminating.
Jan 29 14:36:41 raspi.example.com named[4191]: shutting down
Jan 29 14:36:41 raspi.example.com named[4191]: stopping command channel on 127.0.0.1#953
Jan 29 14:36:41 raspi.example.com named[4191]: no longer listening on 127.0.0.1#53
Jan 29 14:36:41 raspi.example.com named[4191]: exiting
Jan 29 14:36:41 raspi.example.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Jan 29 14:36:41 raspi.example.com systemd[1]: Unit named.service entered failed state  

named.service文件

[Unit]
Description=Berkeley Internet Name Domain (DNS)
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/named
Environment=KRB5_KTNAME=/etc/named.keytab
PIDFile=/run/named/named.pid
ExecStartPre=/usr/libexec/generate-rndc-key.sh
ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf
ExecStart=/usr/sbin/named -u named $OPTIONS
ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID'
ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID'
PrivateTmp=true
[Install]
WantedBy=multi-user.target

Answers:


8

回答。

这是一行:

启动后不可读(尚未?)的PID文件/run/named/named.pid。

(还?)把我扔了。我以为抛出该消息是因为它试图在通过named写入之前读取PID文件,并且由于此后我没有看到错误,所以我认为它最终可以成功读取它。我读英语真傻。实际上,namedpidto 写入到/var/run/named/named.pid从未被systemctl(或systemd)读取的。

更改了PIDFile named.service并启动。喜悦。


太好了,谢谢您的回答。让我难过了。
vonbrand

1
/ var / run应该是/ run的符号链接...
CameronNemo 2014年

哦,Linux变幻莫测,我讨厌Linux发行版和软件包开发中的许多烦人的事情之一。当您使用/ var / run时,/ run是多余的,这应该是pid文件之类的可变内容应存放的位置。
mike fratto 2014年

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.