New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crond never starts in AppVMs #909

Closed
marmarek opened this Issue Mar 8, 2015 · 15 comments

Comments

Projects
None yet
2 participants
@marmarek
Member

marmarek commented Mar 8, 2015

Reported by cprise on 28 Oct 2014 11:33 UTC
The crond.service is never started when an AppVM boots up, and changing its status to 'enabled' with systemctl in the templateVM has no effect.

I haven't yet tested this with regular Fedora; Thinking it may be some side-effect of the way Qubes uses systemd.

See discussion https://groups.google.com/forum/#!topic/qubes-users/vVw1kZ1ph_A

Migrated-From: https://wiki.qubes-os.org/ticket/909

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by anonymous on 28 Oct 2014 21:49 UTC
The other discussion critical to this issue is here:
https://groups.google.com/forum/#!searchin/qubes-users/persistence$20in$20appvm/qubes-users/7DzdDDXFbso/hQs1o1RXYHkJ

I had to make /var/spool a symlink to a folder in /rw because cron and especially anacron need to keep track of activity across reboots.

I am guessing that systemd runs crond.service before /rw gets mounted (see below...). Any way to fix this?

$ sudo systemctl status crond.service
crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled)
Active: failed (Result: exit-code) since Tue 2014-10-28 07:13:10 EDT; 4h 42min ago
Main PID: 709 (code=exited, status=1/FAILURE)

Oct 28 07:13:10 fedora-20-MM systemd[Started Command Scheduler.
Oct 28 07:13:10 fedora-20-MM crond709: /var/spool/cron: No such file or directory
Oct 28 07:13:10 fedora-20-MM crond[/var/spool/cron: mkdir: No such file or directory
Oct 28 07:13:10 fedora-20-MM systemd1: crond.service: main process exited, code=exited, status=...LURE
Oct 28 07:13:10 fedora-20-MM systemd[1]: Unit crond.service entered failed state.

Member

marmarek commented Mar 8, 2015

Comment by anonymous on 28 Oct 2014 21:49 UTC
The other discussion critical to this issue is here:
https://groups.google.com/forum/#!searchin/qubes-users/persistence$20in$20appvm/qubes-users/7DzdDDXFbso/hQs1o1RXYHkJ

I had to make /var/spool a symlink to a folder in /rw because cron and especially anacron need to keep track of activity across reboots.

I am guessing that systemd runs crond.service before /rw gets mounted (see below...). Any way to fix this?

$ sudo systemctl status crond.service
crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled)
Active: failed (Result: exit-code) since Tue 2014-10-28 07:13:10 EDT; 4h 42min ago
Main PID: 709 (code=exited, status=1/FAILURE)

Oct 28 07:13:10 fedora-20-MM systemd[Started Command Scheduler.
Oct 28 07:13:10 fedora-20-MM crond709: /var/spool/cron: No such file or directory
Oct 28 07:13:10 fedora-20-MM crond[/var/spool/cron: mkdir: No such file or directory
Oct 28 07:13:10 fedora-20-MM systemd1: crond.service: main process exited, code=exited, status=...LURE
Oct 28 07:13:10 fedora-20-MM systemd[1]: Unit crond.service entered failed state.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by marmarek on 3 Nov 2014 20:52 UTC

Member

marmarek commented Mar 8, 2015

Modified by marmarek on 3 Nov 2014 20:52 UTC

@marmarek marmarek added this to the Release 2.1 (post R2) milestone Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by marmarek on 13 Jan 2015 23:42 UTC

Member

marmarek commented Mar 8, 2015

Modified by marmarek on 13 Jan 2015 23:42 UTC

@marmarek marmarek self-assigned this Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Modified by marmarek on 14 Jan 2015 02:22 UTC

Member

marmarek commented Mar 8, 2015

Modified by marmarek on 14 Jan 2015 02:22 UTC

@marmarek

This comment has been minimized.

Show comment
Hide comment

@marmarek marmarek closed this Mar 8, 2015

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 8, 2015

Member

Comment by marmarek on 27 Jan 2015 00:19 UTC
Now the service can be enabled by 'crond' qvm-service.

Member

marmarek commented Mar 8, 2015

Comment by marmarek on 27 Jan 2015 00:19 UTC
Now the service can be enabled by 'crond' qvm-service.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 20, 2016

Member

Could you please explain the rationale behind why crond does not run by default in any VM?

Member

adrelanos commented Jun 20, 2016

Could you please explain the rationale behind why crond does not run by default in any VM?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 20, 2016

Member

In most cases none of crond started scripts makes sense in AppVM because changes in root filesystem are discarded. Like updatedb, mandb, prelink etc. And in most cases are harmful for performance (imagine 10 AppVMs running updatedb at the same time).
So instead of manually disabling dozen of them, disable cron as the whole, allowing to enable it if someone really needs.
Systemd timers are not affected by this.

Member

marmarek commented Jun 20, 2016

In most cases none of crond started scripts makes sense in AppVM because changes in root filesystem are discarded. Like updatedb, mandb, prelink etc. And in most cases are harmful for performance (imagine 10 AppVMs running updatedb at the same time).
So instead of manually disabling dozen of them, disable cron as the whole, allowing to enable it if someone really needs.
Systemd timers are not affected by this.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 20, 2016

Member

Makes sense. Thank you!

What about anacron? Would not the same apply to it?

Member

adrelanos commented Jun 20, 2016

Makes sense. Thank you!

What about anacron? Would not the same apply to it?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 20, 2016

Member

What about anacron? Would not the same apply to it?

Yes, exactly. But it is started from crond (in cron.hourly), so both are covered.

Member

marmarek commented Jun 20, 2016

What about anacron? Would not the same apply to it?

Yes, exactly. But it is started from crond (in cron.hourly), so both are covered.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 20, 2016

Member

Are you sure anacron is not called from other places also?

apt-file list anacron

Relevant excerpt.

anacron: /etc/init.d/anacron
anacron: /etc/init/anacron.conf

anacron: /lib/systemd/system/anacron-resume.service
anacron: /lib/systemd/system/anacron.service
anacron: /usr/lib/pm-utils/power.d/anacron
anacron: /usr/lib/pm-utils/sleep.d/95anacron

I've just installed the anacron package and checked 'sudo service
anacron status' - and it's running announcing to run /etc/cron[...].

Member

adrelanos commented Jun 20, 2016

Are you sure anacron is not called from other places also?

apt-file list anacron

Relevant excerpt.

anacron: /etc/init.d/anacron
anacron: /etc/init/anacron.conf

anacron: /lib/systemd/system/anacron-resume.service
anacron: /lib/systemd/system/anacron.service
anacron: /usr/lib/pm-utils/power.d/anacron
anacron: /usr/lib/pm-utils/sleep.d/95anacron

I've just installed the anacron package and checked 'sudo service
anacron status' - and it's running announcing to run /etc/cron[...].

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 20, 2016

Member

Ah, so my comment applies only to Fedora then. I think it would be good idea to start in conditionally on crond qvm-service (similar to Fedora) and add to crond description in qvm-service. Any reason to give it a separate entry?

Member

marmarek commented Jun 20, 2016

Ah, so my comment applies only to Fedora then. I think it would be good idea to start in conditionally on crond qvm-service (similar to Fedora) and add to crond description in qvm-service. Any reason to give it a separate entry?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 20, 2016

Member
Member

adrelanos commented Jun 20, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 20, 2016

Member

Would you like to reopen or do you prefer me to open a new ticket?

Since this was for R2.0, better new one.

Member

marmarek commented Jun 20, 2016

Would you like to reopen or do you prefer me to open a new ticket?

Since this was for R2.0, better new one.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 23, 2016

Member

Created #2109 for it.

Member

adrelanos commented Jun 23, 2016

Created #2109 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment