首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Ubuntu 18.04上启动CUPS

无法在Ubuntu 18.04上启动CUPS
EN

Ask Ubuntu用户
提问于 2018-09-10 20:49:51
回答 2查看 8.2K关注 0票数 0

我在Ubuntu18.04仿生海狸上安装了像这样的杯子

代码语言:javascript
复制
$ sudo apt-get update
$ sudo apt-get install cups

我检查了杯子的状态,结果没有启动。

代码语言:javascript
复制
$ systemctl status cups

 ● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-09-10 16:29:40 EDT; 3s ago
     Docs: man:cupsd(8)
  Process: 2895 ExecStart=/usr/sbin/cupsd -l (code=exited, status=1/FAILURE)
 Main PID: 2895 (code=exited, status=1/FAILURE)

Sep 10 16:29:40 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 16:29:40 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 5.
Sep 10 16:29:40 chrisni-X456UJ systemd[1]: Stopped CUPS Scheduler.
Sep 10 16:29:40 chrisni-X456UJ systemd[1]: cups.service: Start request repeated too quickly.
Sep 10 16:29:40 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 16:29:40 chrisni-X456UJ systemd[1]: Failed to start CUPS Scheduler.

我编辑了cupsd.conf,并将LogLevel从“警告”改为“调试”。我尝试手动启动cups,但是相同的输出重复。

代码语言:javascript
复制
$ systemctl start cups
$ systemctl status cups

这是log,显示的块是重复的。

代码语言:javascript
复制
$ grep cups /var/log/syslog

Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 1.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 2.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 15:56:36 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 3.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 4.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Service hold-off time over, scheduling restart.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Scheduled restart job, restart counter is at 5.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Start request repeated too quickly.
Sep 10 15:56:37 chrisni-X456UJ systemd[1]: cups.service: Failed with result 'exit-code'.
Sep 10 16:02:15 chrisni-X456UJ systemd[1]: cups.service: Main process exited, code=exited, status=1/FAILURE

有谁知道我怎么开始杯子的吗?

EN

回答 2

Ask Ubuntu用户

发布于 2020-07-14 14:50:46

看看/var/log/cups/error_log的尾部:

代码语言:javascript
复制
X [14/Jul/2020:15:06:38 +0200] No valid Listen or Port lines were found in the configuration file.

实际上,配置文件被其他一些设置破坏了,但幸运的是保留了一个备份:

代码语言:javascript
复制
ll /etc/cups/cupsd.conf*
-rw-r----- 1 root 4571 2020-07-01 19:53 /etc/cups/cupsd.conf.O
-rw-r----- 1 root   22 2020-07-01 19:54 /etc/cups/cupsd.conf

这为我(在Ubuntu18.04中)恢复cupsd.conf和重新启动cups起了作用:

代码语言:javascript
复制
sudo -i
cd /etc/cups
cp cupsd.conf.O cupsd.conf
systemctl restart cups

通过下列方式核实:

代码语言:javascript
复制
systemctl status cups
票数 1
EN

Ask Ubuntu用户

发布于 2021-02-17 01:10:47

我发现了系统未启动的系统错误。所以我搜索错误,然后去了https://linuxhandbook.com/system-has-not-been-booted-with-systemd/。因此,我使用的不是systemctl重启cups,而是使用service cups重新启动。然后使用service cups状态进行检查。一切都很好。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1074086

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档