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

Support top-level type drop-ins (pod.d, container.d, etc) and truncated unit drop-ins (name-.container.d) for quadlet #23158

Closed
benniekiss opened this issue Jul 1, 2024 · 5 comments · Fixed by #23265
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet

Comments

@benniekiss
Copy link
Contributor

benniekiss commented Jul 1, 2024

Feature request description

Regular systemd unit files allow for top-level type drop-ins, such as service.d/ and socket.d/. Quadlet generated files should support this as well. For example, drop-in files in pod.d/ should be applied to all generated .pod files.

@benniekiss benniekiss added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 1, 2024
@Luap99 Luap99 added the quadlet label Jul 2, 2024
@Luap99
Copy link
Member

Luap99 commented Jul 2, 2024

What kind of options would you like to set "globally"?

We already have a config file for setting defaults, containers.conf.

cc @ygalblum @alexlarsson

@benniekiss
Copy link
Contributor Author

benniekiss commented Jul 2, 2024

I was thinking more along the lines of [Unit], [Service], and [Install] sections to set these globally for Quadlet files. For instance, a global Restart=always or WantedBy=default.target

@benniekiss
Copy link
Contributor Author

It would also be helpful to support drop-ins for truncated units, where drop-ins in directories like {CONTAINER_NAME}-.container.d/ were applied to all .container quadlet files beginning with {CONTAINER_NAME}-

@Luap99
Copy link
Member

Luap99 commented Jul 8, 2024

It would also be helpful to support drop-ins for truncated units, where drop-ins in directories like {CONTAINER_NAME}-.container.d/ were applied to all .container quadlet files beginning with {CONTAINER_NAME}-

Is this something systemd can do? I think it is best to keep the logic is similar to the systemd parsing as possible.

@benniekiss
Copy link
Contributor Author

benniekiss commented Jul 8, 2024

Yes, it is. The drop-in functionality is described in the 12th paragraph block in the description section here

Moreover for unit names containing dashes ("-"), the set of directories generated by repeatedly truncating the unit name after all dashes is searched too. Specifically, for a unit name foo-bar-baz.service not only the regular drop-in directory foo-bar-baz.service.d/ is searched but also both foo-bar-.service.d/ and foo-.service.d/. This is useful for defining common drop-ins for a set of related units, whose names begin with a common prefix. This scheme is particularly useful for mount, automount and slice units, whose systematic naming structure is built around dashes as component separators. Note that equally named drop-in files further down the prefix hierarchy override those further up, i.e. foo-bar-.service.d/10-override.conf overrides foo-.service.d/10-override.conf.

@benniekiss benniekiss changed the title Support top-level type drop-ins for quadlet (pod.d, container.d, etc) Support top-level type drop-ins (pod.d, container.d, etc) and truncated unit drop-ins (name-.container.d) for quadlet Jul 8, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Oct 17, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants