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 ZFS messages #3

Closed
gmelikov opened this issue May 21, 2020 · 0 comments · Fixed by #49
Closed

Add ZFS messages #3

gmelikov opened this issue May 21, 2020 · 0 comments · Fixed by #49
Labels
documentation Improvements or additions to documentation

Comments

@gmelikov
Copy link
Member

https://github.com/zfsonlinux/zfsonlinux.github.com/tree/master/msg

@gmelikov gmelikov added the documentation Improvements or additions to documentation label Jul 29, 2020
@gmelikov gmelikov assigned ghost Aug 26, 2020
OtherJohnGray added a commit to OtherJohnGray/openzfs-docs that referenced this issue Feb 17, 2021
Hi, I'm not sure if this is correct or not - but this change removes section 4.15, "Patch a dependency loop", as it seems that this is no longer required now that openzfs/zfs#10388 has been merged?

Following the current instructions in 4.15 generates the following console output:

```
root@rescue ~ # curl https://launchpadlibrarian.net/478315221/2150-fix-systemd-dependency-loops.patch | \
>     sed "s|/etc|/lib|;s|\.in$||" | (cd / ; sudo patch -p1)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1487  100  1487    0     0   4260      0 --:--:-- --:--:-- --:--:--  4260
patching file lib/systemd/system-generators/zfs-mount-generator
Hunk openzfs#1 FAILED at 42.
Hunk openzfs#2 FAILED at 62.
Hunk openzfs#3 succeeded at 157 with fuzz 2 (offset 80 lines).
2 out of 3 hunks FAILED -- saving rejects to file lib/systemd/system-generators/zfs-mount-generator.rej
patching file lib/systemd/system/zfs-mount.service
Hunk openzfs#1 FAILED at 6.
1 out of 1 hunk FAILED -- saving rejects to file lib/systemd/system/zfs-mount.service.rej
```

/lib/systemd/system/zfs-mount.service.rej contains the following:

```
root@rescue ~ # cat /lib/systemd/system-generators/zfs-mount-generator.rej
--- lib/systemd/system-generators/zfs-mount-generator
+++ lib/systemd/system-generators/zfs-mount-generator
@@ -42,6 +42,8 @@
   do_fail "zero or three arguments required"
 fi

+pools=$(zpool list -H -o name)
+
 # For ZFSs marked "auto", a dependency is created for local-fs.target. To
 # avoid regressions, this dependency is reduced to "wants" rather than
 # "requires". **THIS MAY CHANGE**
@@ -62,6 +64,7 @@
   set -f
   set -- $1
   dataset="${1}"
+  pool="${dataset%%/*}"
   p_mountpoint="${2}"
   p_canmount="${3}"
   p_atime="${4}"
```

/lib/systemd/system-generators/zfs-mount-generator seems to already contain equivalent code to the rejected hunks, and the accepted hunk seems to generate a code block starting line 160, that seems like a partial and older version of the code block at line 121?
```
121   # If the pool is already imported, zfs-import.target is not needed.  This
122   # avoids a dependency loop on root-on-ZFS systems:
123   # systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount
124   # After zfs-import.target After zfs-import-{cache,scan}.service After
125   # cryptsetup.service After systemd-random-seed.service.
126   #
127   # Pools are newline-separated and may contain spaces in their names.
128   # There is no better portable way to set IFS to just a newline.  Using
129   # $(printf '\n') doesn't work because $(...) strips trailing newlines.
130   IFS="
131 "
132   for p in $pools ; do
133     if [ "$p" = "$pool" ] ; then
134       after=""
135       wants=""
136       break
137     fi
138   done
. . . . . 
160   # If the pool is already imported, zfs-import.target is not needed.  This
161   # avoids a dependency loop on root-on-ZFS systems:
162   # systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount
163   # After zfs-import.target After zfs-import-{cache,scan}.service After
164   # cryptsetup.service After systemd-random-seed.service.
165   for p in $pools ; do
166     if [ "$p" = "$pool" ] ; then
167       wants=""
168       break
169     fi
170   done
```

/lib/systemd/system/zfs-mount.service.rej contains the following:
```
--- lib/systemd/system/zfs-mount.service
+++ lib/systemd/system/zfs-mount.service
@@ -6,7 +6,6 @@
 After=zfs-import.target
 After=systemd-remount-fs.service
 Before=local-fs.target
-Before=systemd-random-seed.service
 After=zfs-load-module.service
 ConditionPathExists=/sys/module/zfs
```
And /lib/systemd/system/zfs-mount.service does not contain the string "Before=systemd-random-seed.service"


...Is it therefore right to remove section 4.15 from this manual?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant