-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Multiple systemd/dracut fixes/changes #8510
Multiple systemd/dracut fixes/changes #8510
Conversation
90adaaa
to
ca7e86e
Compare
Well, all three commits modify the same line in the two unit files and depend on each...
If you insist, I can split them tomorrow. Just give me a hint, which of my changes you might not want to merge.
… Am 18.03.2019 um 00:53 schrieb kpande ***@***.***>:
we might want some but not all of these changes, can you break them into separate PRs for easier review?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
ca7e86e
to
6bdc0c7
Compare
@behlendorf -m1 does not work here because of the negative match. (AFAIK. I can‘t test this right now.)
When there are multiple matches, how should we know which one is the right one? Hoping the first one is always correct does not really sound right to me..
… Am 18.03.2019 um 22:09 schrieb Brian Behlendorf ***@***.***>:
@behlendorf commented on this pull request.
In contrib/dracut/systemd/zfs-dracut-bootfs.service.in:
> @@ -0,0 +1,10 @@
+[Unit]
+Description=Set BOOTFS environment for dracut
+Documentation=man:zfs(8)
+DefaultDependencies=no
+After=zfs-import.target
+Requires=zfs-import.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "/bin/systemctl set-environment ***@***.***@/zpool list -H -o bootfs | grep -v '^-$')"
I believe you should add -m1 to the grep so it exits on first match (like the previous awk).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
On a properly configured system there should only be one match. But when that's not the case picking the first one at least allows us to do something sensible. Let's at least keep the behavior consistent until we can do something better. I'd be OK with |
6bdc0c7
to
51c4ca0
Compare
I added |
a98d6d9
to
517b5ff
Compare
The packaging issue is resolved now, too |
This is a bit pedantic, but technically speaking, the |
517b5ff
to
c49a150
Compare
Full ACK. Fixed |
c49a150
to
ee0578b
Compare
In thinking about this some more, a |
@rlaager @behlendorf Proof: $ echo -e '-\n-\nrpool/ROOT\ndpool/ROOT' | grep -m1 -v '^-$'
rpool/ROOT I will change this to |
ee0578b
to
4573ea8
Compare
827a79f
to
1042ed3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contrib/dracut/90zfs
module directory does seem like a reasonable place to put these. I'm not an expert in this area either, but I'm OK with adding them here.
90e2ec9
to
c1fb1e7
Compare
741ae90
to
8e7e99b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c0d3z3r0 thanks for sorting this out. I'm happy with the updated version, but it would be great if we could get a few more reviewers who are familiar with this area to approve it too.
zfs-import-* services have a hard dependency on bash while not everyone has bash installed. At this point /bin/sh is sufficient, so use that. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Issue #8510
On debian, systemd complains about missing /bin/awk because it actually is located at /usr/bin/awk. It is not a good idea to hardcode binary paths because different linux distros use different paths. According to systemd's man page it is absolutely safe to miss paths for binaries located at standard locations (/bin, /sbin, /usr/bin, ...). Further, replace this more or less complicated awk command by grep. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Issue #8510
I've cherry picked the first two simple commits in to master since there's no reason to hold them up any longer. @c0d3z3r0 would you mind rebasing only your last commit on master while we allow some time for additional reviewers. Thanks. e03b25a Fix systemd-import services |
Dracut depends on the environment variable BOOTFS to be set after pool import. This dracut specific systemd ExecStartPost command should not be called for any non-dracut systems, so let's move it to a static systemd unit that. Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
8e7e99b
to
74204e8
Compare
My review was for commits which no longer exist on this PR.
I removed my stale review. I don't see anything that jumps out at me as wrong, but I am not familiar with dracut, so I can't give a useful approval here. |
Codecov Report
@@ Coverage Diff @@
## master #8510 +/- ##
==========================================
- Coverage 78.76% 78.66% -0.11%
==========================================
Files 381 381
Lines 117499 117499
==========================================
- Hits 92553 92426 -127
- Misses 24946 25073 +127
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested fine
For some reason I didn't have zfs.target enabled and that caused zfs-mount to not start. I don't see a change in this commit that would have done that though (probably one of the other dracut commits)
Thank you!
Do you mean zfs.target in the rootfs / after initramfs ( |
ya, after initram |
Thanks everybody. I'll go ahead and get this merged this tomorrow. If you have any remaining concerns please post before then. |
Motivation and Context / Description
Remove hard dependency on bash
zfs-import-* services have a hard dependency on bash while not everyone
has bash installed. At this point /bin/sh is sufficient, so use that.
Fix systemd-import services
On debian systemd complains about missing /bin/awk because it actually
is located at /usr/bin/awk. It is not a good idea to hardcode binary
paths because linux distros use different paths. According to systemd's
man page it is absolutely safe to miss paths for binary located at
standard locations (/bin, /sbin, /usr/bin, ...).
Further, replace this more or less complicated awk command by egrep.
Move dracut specifics to dracut mount unit
Dracut depends on BOOTFS environment variable to be set after pool
import. This dracut specific systemd ExecStartPost command should not be
called for any non-dracut systems, so let's move it to a static systemd
unit that gets pulled in by the generated mount unit.
At the moment, the new systemd service does not get installed / packaged. I did not get this to work... any hint from you would be great :-)Update: Fixed.How Has This Been Tested?
Tested WITHOUT dracut! Maybe someome with a dracut (test) setup can test this?
Types of changes
Checklist:
Signed-off-by
.