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

logrotate.conf: fixes for systemd #5086

Merged
merged 1 commit into from Jun 26, 2015
Merged

logrotate.conf: fixes for systemd #5086

merged 1 commit into from Jun 26, 2015

Conversation

smithfarm
Copy link
Contributor

Before this patch, the command 'logrotate -f /etc/logrotate.d/ceph'
was generating an error "Failed to reload ceph.target: Job type reload is not
applicable for unit ceph.target".

Before we issue systemctl reload, check that there is at least
one active ceph-* service.

Since we use grep, make the grep package a dependency.

http://tracker.ceph.com/issues/12173 Fixes: #12173

Signed-off-by: Tim Serong tserong@suse.com
Signed-off-by: Lars Marowsky-Bree lmb@suse.com
Signed-off-by: Nathan Cutler ncutler@suse.com

@ghost
Copy link

ghost commented Jun 26, 2015

@smithfarm I know nothing of systemd and probably not the best person to review what looks like a very fine commit.

@ghost ghost removed their assignment Jun 26, 2015
@smithfarm
Copy link
Contributor Author

I can't fathom why the test is failing in this way. I can see that the test is calling "ceph-disk activate" which then (apparently) calls ceph-osd, which returns -15:

subprocess.CalledProcessError: Command '['ceph-osd', '--cluster', 'ceph', 
'--mkfs', '--mkkey', '-i', '0', '--monmap', 'testdir/osd-config/0/activate.monmap', 
'--osd-data', 'testdir/osd-config/0', '--osd-journal', 'testdir/osd-config/0/journal', 
'--osd-uuid', '3e7bad3f-8c36-4fdf-a2d3-33c77798598c', '--keyring', 
'testdir/osd-config/0/keyring']' returned non-zero exit status -15

At that point, the trail goes cold for me.

@smithfarm
Copy link
Contributor Author

running it through the make check bot one more time

@smithfarm
Copy link
Contributor Author

also running make check locally in EL7 docker container

@@ -8,6 +8,10 @@
service ceph reload >/dev/null
elif which invoke-rc.d > /dev/null 2>&1 && [ -x `which invoke-rc.d` ]; then
invoke-rc.d ceph reload >/dev/null
elif which systemctl > /dev/null 2>&1 && [ -x `which systemctl` ]; then
if systemctl is-active 'ceph-*' | grep -i active > /dev/null 2>&1 ; then
systemctl reload 'ceph-*' >/dev/null
Copy link
Member

Choose a reason for hiding this comment

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

Do we care about the exit code of systemctl reload here? If not we could tack on "|| : . (just looking at what other packages do)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean systemctl reload 'ceph-*' || : instead of systemctl reload 'ceph-*' >/dev/null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or systemctl reload 'ceph-*' >/dev/null || : ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, now I see that the point is to ensure that we don't leave $? set to false for no good reason. So the latter. Will do.

@ktdreyer
Copy link
Member

Looks good to me! @dachary mind confirming that the make check bot failure isn't related to this change?

@smithfarm
Copy link
Contributor Author

I ran make check in a CentOS 7 docker container and PASS: test/osd/osd-config.sh so it would seem the bot failure is "environmental noise"?

Before this patch, the command 'logrotate -f /etc/logrotate.d/ceph'
was generating an error "Failed to reload ceph.target: Job type reload is not
applicable for unit ceph.target".

Before we issue systemctl reload, check that there is at least
one active ceph-* service. (The hyphen is significant.)

Since we use grep, make the grep package a dependency.

http://tracker.ceph.com/issues/12173 Fixes: ceph#12173

Signed-off-by: Tim Serong <tserong@suse.com>
Signed-off-by: Lars Marowsky-Bree <lmb@suse.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
@smithfarm
Copy link
Contributor Author

Local make check completed successfully. @ktdreyer || : tacked on.

@ktdreyer
Copy link
Member

Ok, let's merge this and assume the make check bot failure is spurious :)

@ktdreyer ktdreyer merged commit 05424a8 into ceph:master Jun 26, 2015
ktdreyer added a commit that referenced this pull request Jun 26, 2015
logrotate.conf: fixes for systemd

Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
@jan--f jan--f deleted the wip-12173 branch February 8, 2017 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants