将慢速`udev-configure-printer`从systemd boot移到登录后提示符

我今天一直在调整我的启动速度。 第一步是删除:

6.194s NetworkManager-wait-online.service 

要删除它,我使用:

 systemctl disable NetworkManager-wait-online.service 

现在我的启动时间显示:

 $ systemd-analyze Startup finished in 3.407s (kernel) + 8.356s (userspace) = 11.764s 

网络仍然正常运行,因此看起来没有任何损害。

systemd-analyze blame列表的下一步是:

  5.467s udev-configure-printer@-devices-pci0000:00-0000:00:14.0-usb3-3\x2d3-3\x2d3.1.service 

我一个月只使用我的打印机几次,在启动阶段我当然不需要它。 我的问题是; 如何将CUPS初始化从启动序列中移出到启动后应用程序/etc/rc.local类的后启动环境或任何有意义的地方?

或者可以告诉系统在登录屏幕出现后加载服务? 或者告诉他们在加载服务之前等待15秒?


我尝试了什么

使用此处的说明,我将目标设置为登录提示之后。 我通过编辑/lib/systemd/system/udev-configure-printer.service来做到这一点,如下所示:

 [Unit] Description=Automatic USB/Bluetooth printer setup (%i) # July 29, 2017 - Move from startup (5 seconds time) to after login screen After=lightdm.service [Service] #Type=simple Type=forking GuessMainPID=true ExecStart=/lib/udev/udev-configure-printer add %I # This ExecStop would be useful to disable the print queue when ippusbxd # crashes or gets killed, but in the case that ippusbxd does not get started # at all during the process run by ExecStart (printer does not support # IPP-over-USB) ExecStop gets run immediately making a printer getting # disabled again right after it getting enabled or set up # ExecStop=/lib/udev/udev-configure-printer remove %I 

即使重启两次以确认速度,启动时间也从11秒增加到16秒。