Skip to content
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

Add postgresql service to requirements #4971

Merged
merged 1 commit into from Jan 6, 2023
Merged

Add postgresql service to requirements #4971

merged 1 commit into from Jan 6, 2023

Conversation

baierjan
Copy link
Member

@baierjan baierjan commented Jan 5, 2023

If this unit gets activated, the units listed in Requires= will be activated as well. If one of the other units fails to activate, and an ordering dependency After= on the failing unit is set, this unit will not be started. Besides, with or without specifying After=, this unit will be stopped (or restarted) if one of the other units is explicitly stopped (or restarted).

Reference: https://progress.opensuse.org/issues/122578

Copy link
Member

@kraih kraih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After checking the systemd docs, the combination of After and Requires looks correct to me.

@Martchus
Copy link
Contributor

Martchus commented Jan 5, 2023

What about the other services needing postgresql? Shouldn't they be treated in the same way?

@kraih
Copy link
Member

kraih commented Jan 5, 2023

What about the other services needing postgresql? Shouldn't they be treated in the same way?

Or they have a Requires on the webui.

If this unit gets activated, the units listed in Requires= will be
activated as well. If one of the other units fails to activate, and an
ordering dependency After= on the failing unit is set, this unit will
not be started. Besides, with or without specifying After=, this unit
will be stopped (or restarted) if one of the other units is explicitly
stopped (or restarted).

Reference: https://progress.opensuse.org/issues/122578
@perlpunk
Copy link
Contributor

perlpunk commented Jan 6, 2023

I retriggered CircleCI jobs, we had various problems there

@mergify mergify bot merged commit a1544ff into master Jan 6, 2023
@okurz okurz deleted the fix_unit_files branch January 8, 2023 13:52
@okurz
Copy link
Member

okurz commented Jan 8, 2023

hm, this introduces a strong requirement on PostgreSQL. But what for hosts that don't actually run the database but use a remote database that we support just as well? I am not sure if https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Wants=would also help for stopping services but one could try.

@baierjan
Copy link
Member Author

baierjan commented Jan 8, 2023

Right, this will require to have the webui on the database server. Maybe we can go around by dropping a symlink into openqa-webui.service.requires directory if postgresql.service is detected; or having multiple service file for each use-case, similar to our multiple worker setup (openqa-worker-plain vs. openqa-worker-auto-restart). I am afraid that both use-cases cannot be implemented inside one service file. What about having something like openqa-webui-standalone.service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants