Skip_autostart does not prevent automatic start of sys-usb

TLDR: Why does crond start qubes when qubes.skip_autostart is set ?

[edited to give the full kernel command line options, and to add tldr…]

For reasons, I needed to prevent automatic start of sys-usb on qubes startup. (sys-usb was causing immediate loss of the desktop, with black screen, no keyboard or mouse).

When I add qubes.skip_autostart to the kernel command line in grub, I could see the graphical login prompt, login, and get a first few clicks or keypresses, before sys-usb started automatically → Black screen, etc.

Finally, I found I could add
qubes.skip_autostart systemd.mask=crond.service
This allowed access to the desktop and to text consoles, and to fix the problem.

It seems that multi-user target requires startup of all qubes which are set to autostart. There is a file named ‘/etc/systemd/system/multi-user.target.wants/qubes-vm@sys-usb.service’, and similar files for all the other autostart qubes. Each of them is symlinked to /usr/lib/systemd/system/qubes-vm@.service.

I got lucky, I think, because masking crond prevented systemd from continuing the preparation for multi-user.
I see nothing in any of the cron files which looks like it could cause sys-usb to start, BUT I can see many lines in journalctl like this:
`dom0 CROND[123445]: (user) CMD (qvm-start --skip-if-running sys-usb…’

All is working now, but I would really like to understand :

  • How do I get crond messages in the journal for tasks I cannot find in /etc/*cron* ?
  • do I have some missing file(s) or some leftovers, because this system has been upgraded through several Qubes-os versions?
  • Alternatively, have I made some weird, long forgotten, customisation to cause this?
  • Or did I miss something else? (not unlikely, given my ineptness with systemd!)

Very mystified… all suggestions welcome.

1 Like

One of two speculative scenarios comes to mind:

  1. You added a cron(tab) entry to prevent locking yourself out by powering off sys-usb
  2. The Qubes installer adds that nowadays if it detects an installation with a usb keyboard

In any case, seems to be “by design” and it has to be an entry in one of the many /etc/cron* , /etc/anacron* , and /var/spool/cron/* files and directories.
EDIT: in dom0, of course.
EDIT2: upon reading your message again, I’m going to wager a small amount of virtual karma that you have an entry in the “/var/spool/cron/user” crontab file :smile:
EDIT3: … a file which you manipulate using “crontab -e” as user “user” in dom0. Now the answer is complete!

2 Likes

Thank you, thank you, and thank you!

Your Karma bonus is well earned.

You are 100% correct! It was indeed a long-ago crontab -e.

I never imagined there being more than one crontab… with no obvious reference from one to the other, that I could find. I guess I only ever used Cron for sys admin before, in /etc, as root.

Now I can spend some time working out how the rest of the startup dependencies work.

2 Likes