-
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
WIP: Refactor systemd and use /etc/default/zfs if available #3884
Conversation
The first commit isn't really necessary, but I've been increasingly ... "annoyed" that there's stuff that isn't really part of ZoL in the tree. I think it makes more sense to have all that in the |
20760c3
to
79aeba3
Compare
@behlendorf Do we have an (approximate) ETA on this? Tag this |
@@ -63,8 +63,6 @@ AC_CONFIG_FILES([ | |||
etc/Makefile | |||
etc/init.d/Makefile | |||
etc/zfs/Makefile | |||
etc/systemd/Makefile | |||
etc/systemd/system/Makefile |
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.
I don't think this belongs in contrib. This is code we support and maintain as part of the project so I'd like to leave where it is.
@@ -12,4 +12,5 @@ Before=local-fs.target | |||
[Service] | |||
Type=oneshot | |||
RemainAfterExit=yes | |||
ExecStart=@sbindir@/zfs mount -a | |||
ExecStart=@sbindir@/zfs mount -a ${VERBOSE_MOUNT:+-v} ${DO_OVERLAY_MOUNTS:+-O} ${MOUNT_EXTRA_OPTIONS} |
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.
My only concern with this is that VERBOSE_MOUNT="no"
and DO_OVERLAY_MOUNT="no"
. That means both these options will be enabled when they should be disabled. How about limiting this to just MOUNT_EXTRA_OPTIONS
which will work correctly.
@FransUrbo sorry about completely neglecting this. The gist of these changes look entirely reasonable to me. If you can address the issues I mentioned and rebase this against master without the "Rearrangement of some source directories" patch I don't see why we can't get it tested and added as part of the other proposed systemd changes. |
But since there haven't been any, it made sense for us to do it. And But I think contrib is correct in this case. However, we can leave that |
Let's leave the contrib argument for latter and move forward on the rest of these changes. :) |
f7f5c77
to
15803d0
Compare
@behlendorf Ok, I've updated the PR with your remarks fixed. I updated the comments to, maybe you should merge them into one commit when/if accepting it. |
Looking at this and your #4699 again, I think it's possible to merge the two import files into one and just update the documentation for /etc/{sysconfig,default}/zfs to indicate that one could use the |
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
EnvironmentFile=-@initconfdir@/zfs | ||
ExecStartPre=/sbin/modprobe zfs | ||
ExecStart=@sbindir@/zpool import ${ZPOOL_CACHE:+-c "${ZPOOL_CACHE}"} -aN ${ZPOOL_IMPORT_OPTS} |
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.
I'm pretty sure we can write the one line equivalence of
Pseudo code:
if cache exists; then
use cache file
else if ZPOOL_IMPORT_PATH is set; then
use ZPOOL_IMPORT_PATH
fi
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.
Let's leave these two files separate for now. That allows for each to enabled/disabled independently.
Use the /etc/{default,sysconfig}/zfs file in systemd service files. * Instead of looing for the hardcoded @sysconfdir@/zfs/zpool.cache file, use the $ZPOOL_CACHE if/when set. * Instead of using hardcoded /dev/disk/by-id dir in import, use the ZPOOL_IMPORT_PATH if/when set. * Use ZPOOL_IMPORT_OPTS if/when applicable. Signed-off-by: Turbo Fredriksson <[email protected]>
Use the /etc/{default,sysconfig}/zfs file in systemd service files. * Use MOUNT_EXTRA_OPTIONS from mentioned file if/when applicable. Signed-off-by: Turbo Fredriksson <[email protected]>
Use the /etc/{default,sysconfig}/zfs file in systemd service files. * Use the ZED_ARGS variable when starting zed if/when applicable. Signed-off-by: Turbo Fredriksson <[email protected]>
* Add 'Documentation' entry for those service files that don't have any.
3438478
to
734f1b9
Compare
When testing this under CentOS 7 I ran in to numerous problems.
Adding this kind of support I think is a good idea but it needs more testing. |
Closing. While I think this is a good idea the proposed patches just don't work. I ran in to numerous problems as described in the comment above. If someone would like to add this functionality they should open a new PR. |
Rearrangement of some source directories.
Use the /etc/{default,sysconfig}/zfs file in systemd service files (1of3).
Use the /etc/{default,sysconfig}/zfs file in systemd service files (2of3).
zfs mount
if/when applicable.Use the /etc/{default,sysconfig}/zfs file in systemd service files (3of3).
This whole PR is untested, so I'm tagging this WIP.