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 sighup reload configuration files #7311

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

QiWang19
Copy link
Contributor

Support podman service sighup reload configuration files(containers.conf, registries.conf, storage.conf).

Signed-off-by: Qi Wang qiwan@redhat.com

@QiWang19 QiWang19 linked an issue Aug 12, 2020 that may be closed by this pull request
@mheon
Copy link
Member

mheon commented Aug 13, 2020 via email

@mheon
Copy link
Member

mheon commented Aug 13, 2020 via email

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Nice work, @QiWang19!

Only minor nits

go func() {
for {
// Block until the signal is received
<-ch
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a debug message here as well? This could come in handy for support.


// Platform specific signal synonyms
var (
Hup os.Signal = unix.SIGHUP
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Hup os.Signal = unix.SIGHUP
SIGHUP os.Signal = unix.SIGHUP

Might be easier to understand when the identifier is consistent.

@@ -816,3 +818,48 @@ func (r *Runtime) mergeDBConfig(dbConfig *DBConfig) {
func (r *Runtime) EnableLabeling() bool {
return r.config.Containers.EnableLabeling
}

func (r *Runtime) Reload() error {
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment.

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

LGTM once @vrothberg 's concerns are addressed.

@QiWang19 QiWang19 force-pushed the service-reload branch 2 times, most recently from 734676f to 01d5695 Compare August 17, 2020 14:22
Support podman service sighup reload configuration files(containers.conf, registries.conf, storage.conf).

Signed-off-by: Qi Wang <qiwan@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Aug 18, 2020

/approve
/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 18, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: QiWang19, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2020
@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 19, 2020
@openshift-merge-robot openshift-merge-robot merged commit 7e2a1b3 into containers:master Aug 19, 2020
@mheon
Copy link
Member

mheon commented Aug 19, 2020

Woah woah woah. Were my comments here ignored? This does not work if anything related to the OCI runtime or storage paths changed.

@QiWang19
Copy link
Contributor Author

Can I have more details about what is specifically the LIbpod state and storage paths that need to update?
Sorry missed that in this PR, I can set up another PR to fix it.

@mheon
Copy link
Member

mheon commented Aug 19, 2020

We need to:

  • Reload the Libpod database to account for potential changed paths
  • Perform the Libpod initialization process (checking the Alive file, creating it if it does not exist, refreshing containers if it does not exist)
  • Load new OCI runtimes from the configuration file and set a new default OCI runtime

@QiWang19 QiWang19 deleted the service-reload branch August 21, 2020 20:52
@QiWang19
Copy link
Contributor Author

We need to:

* Reload the Libpod database to account for potential changed paths

* Perform the Libpod initialization process (checking the Alive file, creating it if it does not exist, refreshing containers if it does not exist)

* Load new OCI runtimes from the configuration file and set a new default OCI runtime

Does this just need to call makeruntime

func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
after reloading the configuration files?

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman-system-service: support sighup reload
7 participants