404-not-found 大佬有话说 : 2019-12-7 12:37:23
不懂就问,请大佬指点
系统环境Debian10,某妇抢程序需要时间精准,所以用了ntp,但是ntp服务无法启动。
如下
root@PH:~# apt-get install ntp
正在读取软件包列表… 完成
正在分析软件包的依赖关系树
正在读取状态信息… 完成
建议安装:
ntp-doc
下列【新】软件包将被安装:
ntp
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 761 kB 的归档。
解压缩后会消耗 2,062 kB 的额外空间。
获取:1 http://ftp.ca.debian.org/debian buster/main amd64 ntp amd64 1:4.2.8p12+dfsg-4
已下载 761 kB,耗时 1秒 (1,336 kB/s)
正在选中未选择的软件包 ntp。
(正在读取数据库 … 系统当前共安装有 24680 个文件和目录。)
准备解压 …/ntp_1%3a4.2.8p12+dfsg-4_amd64.deb…
正在解压 ntp (1:4.2.8p12+dfsg-4) …
正在设置 ntp (1:4.2.8p12+dfsg-4) …
Created symlink /etc/systemd/system/multi-user.target.wants/ntp.service → /lib/systemd/system/ntp.service.
Job for ntp.service failed because of unavailable resources or another system error.
See "systemctl status ntp.service" and "journalctl -xe" for details.
invoke-rc.d: initscript ntp, action "start" failed.
● ntp.service – Network Time Service
Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
Active: failed (Result: resources)
Docs: man:ntpd(8)
12月 07 01:43:41 PH.Paleur systemd: ntp.service: Failed to run ‘start’ task: No such file or directory
12月 07 01:43:41 PH.Paleur systemd: ntp.service: Failed with result ‘resources’.
12月 07 01:43:41 PH.Paleur systemd: Failed to start Network Time Service.
12月 07 01:56:32 PH.Paleur systemd: ntp.service: Failed to run ‘start’ task: No such file or directory
12月 07 01:56:32 PH.Paleur systemd: ntp.service: Failed with result ‘resources’.
12月 07 01:56:32 PH.Paleur systemd: Failed to start Network Time Service.
12月 07 12:29:53 PH.Paleur systemd: ntp.service: Failed to run ‘start’ task: No such file or directory
12月 07 12:29:53 PH.Paleur systemd: ntp.service: Failed with result ‘resources’.
12月 07 12:29:53 PH.Paleur systemd: Failed to start Network Time Service.
dpkg: 处理软件包 ntp (–configure)时出错:
已安装 ntp 软件包 post-installation 脚本 子进程返回错误状态 1
正在处理用于 systemd (241-7~deb10u2) 的触发器 …
在处理时有错误发生:
ntp
E: Sub-process /usr/bin/dpkg returned an error code (1)
菜鸡一个,不知道怎么处理,求大佬指点
hehe 大佬有话说 : 2019-12-7 12:49:01
Debian 10 为什么还用 ntp ?
404-not-found 大佬有话说 : 2019-12-7 12:55:31
hehe 大佬有话说 : 2019-12-7 12:49
Debian 10 为什么还用 ntp ?
直接从Debian8升级上来的,请问还能使用什么网络同步时间的软件吗?
hehe 大佬有话说 : 2019-12-7 13:02:41
本帖最后由 hehe 于 2019-12-7 13:05 编辑
404-not-found 大佬有话说 : 2019-12-7 12:55
直接从Debian8升级上来的,请问还能使用什么网络同步时间的软件吗?
CentOS官方嫌 ntp 在老旧硬件设备和网络不稳定的环境都会出现时间不准的问题,从 CentOS 7 开始系统内置了一个更先进更智能更准确的校时程序;
Debian官方嫌 ntp 太臃肿,系统内置了一个轻量级的校时服务。
也就是说,卸载掉 ntp,时间会变的比你安装 ntp 更准
404-not-found 大佬有话说 : 2019-12-7 13:10:31
hehe 大佬有话说 : 2019-12-7 13:02
CentOS官方嫌 ntp 在老旧硬件设备和网络不稳定的环境都会出现时间不准的问题,从 CentOS 7 开始系统内置 …
之前Debian8我修改好时区和时间后,过几天就发现时间不对了。
所以用了ntp。
请问大佬说的这个内置的校时服务名称是?我查一下怎么使用
网上能找到的校时服务都是ntp的教程
hehe 大佬有话说 : 2019-12-7 13:15:11
404-not-found 大佬有话说 : 2019-12-7 13:10
之前Debian8我修改好时区和时间后,过几天就发现时间不对了。
所以用了ntp。
请问大佬说的这个内置的校时 …
不用设置,默认就是开机自动启动的
https://s2.ax1x.com/2019/12/07/Qttet1.png
404-not-found 大佬有话说 : 2019-12-7 13:24:21
hehe 大佬有话说 : 2019-12-7 13:15
不用设置,默认就是开机自动启动的
大佬,您看
root@PH:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service – Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: failed (Result: resources) since Sat 2019-12-07 13:18:49 CST; 4min 45s ago
Docs: man:systemd-timesyncd.service(8)
12月 07 13:18:49 PH.Paleur systemd: systemd-timesyncd.service: Service has no hold-off time (RestartSec=0), sched
uling restart.
12月 07 13:18:49 PH.Paleur systemd: systemd-timesyncd.service: Scheduled restart job, restart counter is at 5.
12月 07 13:18:49 PH.Paleur systemd: Stopped Network Time Synchronization.
12月 07 13:18:49 PH.Paleur systemd: systemd-timesyncd.service: Start request repeated too
quickly.
12月 07 13:18:49 PH.Paleur systemd: systemd-timesyncd.service: Failed with result ‘resour
ces’.
12月 07 13:18:49 PH.Paleur systemd: Failed to start Network Time Synchronization.
hehe 大佬有话说 : 2019-12-7 13:37:38
第一步:卸载 ntp
第二步:激活 systemd-timesyncd 开机自启动
第三步:重启服务器
apt purge ntp
systemctl enable systemd-timesyncd
reboot
hehe 大佬有话说 : 2019-12-7 13:38:40
另外,你看一下 systemd-timesyncd 配置文件
/etc/systemd/timesyncd.conf
404-not-found 大佬有话说 : 2019-12-7 13:48:42
hehe 大佬有话说 : 2019-12-7 13:37
第一步:卸载 ntp
第二步:激活 systemd-timesyncd 开机自启动
第三步:重启服务器
还是和上面的报错一样
root@PH:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service – Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: failed (Result: resources) since Sat 2019-12-07 13:39:16 CST; 7min ago
Docs: man:systemd-timesyncd.service(8)
12月 07 13:39:16 PH.Paleur systemd: systemd-timesyncd.service: Service has no hold-off time (RestartSec=0), sched
uling restart.
12月 07 13:39:16 PH.Paleur systemd: systemd-timesyncd.service: Scheduled restart job, restart counter is at 5.
12月 07 13:39:16 PH.Paleur systemd: Stopped Network Time Synchronization.
12月 07 13:39:16 PH.Paleur systemd: systemd-timesyncd.service: Start request repeated too
quickly.
12月 07 13:39:16 PH.Paleur systemd: systemd-timesyncd.service: Failed with result ‘resour
ces’.
12月 07 13:39:16 PH.Paleur systemd: Failed to start Network Time Synchronization.