在 CentOS 里,“spool” 本身不是一个服务,而是打印队列(CUPS)或邮件队列(sendmail/postfix)等使用的目录。
所以“重启 spool”通常指 重启对应的服务。下面按常见场景说明:
CentOS 的打印服务一般是 cups
systemctl restart cups
systemctl status cups
cancel -a
# 或
lpstat -o
cancel <任务ID>
如果你是 邮件队列(/var/spool/mail 或 /var/spool/postfix)
systemctl restart postfix
清空邮件队列:
postsuper -d ALL
systemctl restart sendmail
cron 的任务在 /var/spool/cron
systemctl restart crond
⚠️ 不建议直接删系统 spool 目录
例如清空 CUPS 队列(安全方式):
systemctl stop cups
rm -f /var/spool/cups/*
systemctl start cups
我可以给你最准确的一条命令。