aboutsummaryrefslogtreecommitdiffstats
path: root/etc/systemd
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary srcdir pathsArvind Sankar2020-06-242-11/+11
| | | | | | | | | | There's no need to specify the srcdir explicitly in _HEADERS and EXTRA_DIST. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10493
* Systemd mount generator: don't fail keyload from file if already loadedInsanePrawn2020-03-091-7/+11
| | | | | | | | | | | | | Previously the generated keyload units for encryption roots with keylocation=file://* didn't contain the code to detect if the key was already loaded and would be marked failed in such situations. Move the code to check whether the key is already loaded from keylocation=prompt handling to general key loading code. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #10103
* Systemd mount generator: Generate noauto units; add control propertiesInsanePrawn2020-02-141-26/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors the systemd mount generators and makes the following major changes: - The generator now generates units for datasets marked canmount=noauto, too. These units are NOT WantedBy local-fs.target. If there are multiple noauto datasets for a path, no noauto unit will be created. Datasets with canmount=on are prioritized. - Introduces handling of new user properties which are now included in the zfs-list.cache files: - org.openzfs.systemd:requires: List of units to require for this mount unit - org.openzfs.systemd:requires-mounts-for: List of mounts to require by this mount unit - org.openzfs.systemd:before: List of units to order after this mount unit - org.openzfs.systemd:after: List of units to order before this mount unit - org.openzfs.systemd:wanted-by: List of units to add a Wants dependency on this mount unit to - org.openzfs.systemd:required-by: List of units to add a Requires dependency on this mount unit to - org.openzfs.systemd:nofail: Toggles between a wants and a requires dependency. - org.openzfs.systemd:ignore: Do not generate a mount unit for this dataset. Consult the updated man page for detailed documentation. - Restructures and extends the zfs-mount-generator(8) man page with the above properties, information on unit ordering and a license header. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9649
* Systemd mount generator: Silence shellcheck warningsInsanePrawn2020-02-141-11/+14
| | | | | | | | | | | | Silences a warning about an intentionally unquoted variable. Fixes a warning caused by strings split across lines by slightly refactoring keyloadcmd. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9649
* zfs-mount-generator: Fix escaping for /Richard Laager2020-02-131-1/+1
| | | | | | | | | The correct name for the mount unit for / is "-.mount", not ".mount". Reviewed-by: InsanePrawn <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Antonio Russo <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #9970
* Order zfs-import-*.service after multipathdRichard Laager2020-01-222-0/+2
| | | | | | | | | | | If someone is using both multipathd and ZFS, they are probably using them together. Ordering the zpool imports after multipathd is ready fixes import issues for multipath configurations. Tested-by: Mike Pastore <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #9863
* Avoid here-documents in systemd mount generatorlorenz2020-01-071-8/+14
| | | | | | | | | | | | | | | On some systems - openSUSE, for example - there is not yet a writeable temporary file system available, so bash bails out with an error, 'cannot create temp file for here-document: Read-only file system', on the here documents in zfs-mount-generator. The simple fix is to change these into a multi-line echo statement. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-By: Richard Laager <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Lorenz Hüdepohl <[email protected]> Closes #9802
* Fix encryption logic in systemd mount generatorInsanePrawn2019-11-271-50/+57
| | | | | | | | | | | | Previously the generator would skip a dataset if it wasn't mountable by 'zfs mount -a' (legacy/none mountpoint, canmount off/noauto). This also skipped the generation of key-load units for such datasets, breaking the dependency handling for mountable child datasets. Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9611
* Fix non-absolute path in systemd mount generatorInsanePrawn2019-11-271-1/+1
| | | | | | | | | | Systemd will ignore units that try to execute programs from non-absolute paths. Use hardcoded /bin/sh instead. Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9611
* Fix small typo in systemd mount generatorInsanePrawn2019-11-271-1/+1
| | | | | | | Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9611
* Skip loading already loaded keyWitaut Bajaryn2019-11-081-0/+2
| | | | | | | | | | | | | | | Don't ask for the password / try to load the key if the key for the encryptionroot is already loaded. The user might have loaded the key manually or by other means before the scripts get called. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Witaut Bajaryn <[email protected]> Closes #9495 Closes #9529
* Workaround to avoid a race when /var/lib is a persistent datasetDidier Roche2019-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If /var/lib is a dataset not under <pool>/ROOT/<root_dataset>, as proposed in the ubuntu root on zfs upstream guide (https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS), we end up with a race where some services, like systemd-random-seed are writing under /var/lib, while zfs-mount is called. zfs mount will then potentially fail because of /var/lib isn't empty and so, can't be mounted. Order those 2 units for now (more may be needed) as we can't declare virtually a provide mount point to match "RequiresMountsFor=/var/lib/systemd/random-seed" from systemd-random-seed.service. The optional generator for zfs 0.8 fixes it, but it's not enabled by default nor necessarily required. Example: - rpool/ROOT/ubuntu (mountpoint = /) - rpool/var/ (mountpoint = /var) - rpool/var/lib (mountpoint = /var/lib) Both zfs-mount.service and systemd-random-seed.service are starting After=systemd-remount-fs.service. zfs-mount.service should be done before local-fs.target while systemd-random-seed.service should finish before sysinit.target (which is a later target). Ideally, we would have a way for zfs mount -a unit to declare all paths or move systemd-random-seed after local-fs.target. Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Didier Roche <[email protected]> Closes #9360
* Restore :: in Makefile.amRyan Moeller2019-08-262-0/+2
| | | | | | | | | | | | The double-colon looked like a typo, but it's actually an obscure feature. Rules with :: may appear multiple times and are run independently of one another in the order they appear. The use of :: for distclean-local was conventional, not accidental. Add comments to indicate the intentional use of double-colon rules. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9210
* Fix install error introduced by #9089 (#9205)Brian Behlendorf2019-08-221-1/+1
|\ | | | | Signed-off-by: Paul Dagnelie <[email protected]>
| * Fix install error introduced by #9089Paul Dagnelie2019-08-221-1/+1
| | | | | | | | Signed-off-by: Paul Dagnelie <[email protected]>
* | zfs-mount-genrator: dependencies should be space-separatedyshui2019-08-221-1/+1
|/ | | | | | Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Yuxuan Shui <[email protected]> Closes #9174
* initramfs: fixes for (debian) initramfsMichael Niewöhner2019-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * contrib/initramfs: include /etc/default/zfs and /etc/zfs/zfs-functions At least debian needs /etc/default/zfs and /etc/zfs/zfs-functions for its initramfs. Include both in build when initramfs is configured. * contrib/initramfs: include 60-zvol.rules and zvol_id Include 60-zvol.rules and zvol_id and set udev as predependency instead of debians zdev. This makes debians additional zdev hook unneeded. * Correct initconfdir substitution for some distros Not every Linux distro is using @sysconfdir@/default but @initconfdir@ which is already determined by configure. Let's use it. * systemd: prevent possible conflict between systemd and sysvinit Systemd will not load a sysvinit service if a unit exists with the same name. This prevents conflicts between sysvinit and systemd. In ZFS there is one sysvinit service that does not have a systemd service but a target counterpart, zfs-import.target. Usually it does not make any sense to install both but it is possisble. Let's prevent any conflict by masking zfs-import.service by default. This does not harm even if init.d/zfs-import does not exist. Reviewed-by: Chris Wedgwood <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Tested-by: Alex Ingram <[email protected]> Tested-by: Dreamcat4 <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]> Closes #7904 Closes #9089
* Race between zfs-share and zfs-mount servicesGeorge Wilson2019-07-281-0/+1
| | | | | | | | | | | | | | | | | | When a system boots the zfs-mount.service and the zfs-share.service can start simultaneously. What may be unclear is that sharing a filesystem will first mount the filesystem if it's not already mounted. This means that both service can race to mount the same fileystem. This race can result in a SEGFAULT or EBUSY conditions. This change explicitly defines the start ordering between the two services such that the zfs-mount.service is solely responsible for mounting filesystems eliminating the race between "zfs mount -a" and "zfs share -a" commands. Reviewed-by: Sebastien Roy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #9083
* New service that waits on zvol links to be createdPavel Zakharov2019-07-174-0/+25
| | | | | | | | | | | | | | | | The zfs-volume-wait.service scans existing zvols and waits for their links under /dev to be created. Any service that depends on zvol links to be there should add a dependency on zfs-volumes.target. By default, this target is not enabled. Reviewed-by: Fabian Grünbichler <[email protected]> Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: John Gallagher <[email protected]> Reviewed-by: George Wilson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Zakharov <[email protected]> Closes #8975
* systemd encryption key supportAntonio Russo2019-07-151-2/+52
| | | | | | | | | | | | | | | | | | | | | | Modify zfs-mount-generator to produce a dependency on new zfs-import-key-*.service units, dynamically created at boot to call zfs load-key for the encryption root, before attempting to mount any encrypted datasets. These units are created by zfs-mount-generator, and RequiresMountsFor on the keyfile, if present, or call systemd-ask-password if a passphrase is requested. This patch includes suggestions from @Fabian-Gruenbichler, @ryanjaeb and @rlaager, as well an adaptation of @rlaager's script to retry on incorrect password entry. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Fabian Grünbichler <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #8750 Closes #8848
* Fix zfs-mount-generator for datasets with spacesAntonio Russo2019-05-071-6/+11
| | | | | | | | | | | | | | | | Alternative implementation of @rlaager's original modification of zfs-mount-generator fix, with @chrisrd's comments. Set IFS to be only the tab character, matching our `-H` call in `zfs list`, allowing spaces to appear in dataset names (and mountpoints). Also adds comments explaining our rationale. Reviewed-by: Chris Dunlop <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #8708 Closes #8718
* Move dracut specifics to dracut moduleMichael Niewöhner2019-04-022-2/+0
| | | | | | | | | | | | 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. Reviewed-by: Manuel Amador (Rudd-O) <[email protected]> Reviewed-by: Matthew Thode <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]> Closes #8510
* Fix systemd-import servicesMichael Niewöhner2019-03-292-2/+2
| | | | | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]> Issue #8510
* Remove hard dependency on bashMichael Niewöhner2019-03-292-2/+2
| | | | | | | | | | 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 <[email protected]> Signed-off-by: Michael Niewöhner <[email protected]> Issue #8510
* ZFS mounted NFSv3 shares fail lock reclaimsDon Brady2019-02-151-0/+1
| | | | | | | | | | ZFS NFS shares mounted on a client with NFSv3 and with open locks will fail to reclaim those locks after a server reboot. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #8398
* Minor documentation, logging, and testing typosAntonio Russo2018-06-071-9/+9
| | | | | | | | | This patch collects some minor inconsistencies and typos in the documentation, logging and testing infrastructure. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #7608
* Add canonical mount options zfs-mount-generatorAntonio Russo2018-05-111-14/+99
| | | | | | | | | | | | | | | | | | lib/libzfs/libzfs_mount.c:zfs_add_options provides the canonical mount options used by a `zfs mount` command. Because we cannot call `zfs mount` directly from a systemd.mount unit, we mirror that logic in zfs-mount-generator. The zed script is updated to cache these properties as well. Include a mini-tutorial in the manual page, properly substitute configuration paths in zfs-mount-generator.8.in, and standardize the Makefile. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #7453
* systemd mount generator and tracking ZEDLETAntonio Russo2018-04-064-1/+132
| | | | | | | | | | | | | | | | | | | | | | | | zfs-mount-generator implements the "systemd generator" protocol, producing systemd.mount units from the cached outputs of zfs list, during early boot, integrating with systemd. Each pool has an indpendent cache of the command zfs list -H -oname,mountpoint,canmount -tfilesystem -r $pool which is kept synchronized by the ZEDLET history_event-zfs-list-cacher.sh Datasets not in the cache will be loaded later in the boot process by zfs-mount.service, including pools without a cache. Among other things, this allows for complex mount hierarchies. Reviewed-by: Fabian Grünbichler <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #7329
* Add kernel module auto-loadingBrian Behlendorf2018-03-133-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically a dynamic misc minor number was registered for the /dev/zfs device in order to prevent minor number collisions. This was fine but it prevented us from being able to use the kernel module auto-loaded which requires a known reserved value. Resolve this issue by adding a configure test to find an available misc minor number which can then be used in MODULE_ALIAS_MISCDEV at build time. By adding this alias the zfs kmod is added to the list of known static-nodes and the systemd-tmpfiles-setup-dev service will create a /dev/zfs character device at boot time. This in turn allows us to update the 90-zfs.rules file to make it aware this is a static node. The upshot of this is that whenever a process (zpool, zfs, zed) opens the /dev/zfs the kmods will be automatic loaded. This even works for unprivileged users so there is no longer a need to manually load the modules at boot time. As an additional bonus the zed now no longer needs to start after the zfs-import.service since it will trigger the module load. In the unlikely event the minor number we selected conflicts with another out of tree unregistered minor number the code falls back to dynamically allocating it. In this case the modules again must be manually loaded. Note that due to the change in the method of registering the minor number the zimport.sh test case may incorrectly fail when the static node for the installed packages is created instead of the dynamic one. This issue will only transiently impact zimport.sh for this single commit when we transition and are mixing and matching methods. Reviewed-by: Fabian Grünbichler <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> TEST_ZIMPORT_SKIP="yes" Closes #7287
* Allow modprobe to fail when called within systemdMatthew Thode2018-02-212-2/+2
| | | | | | | | | | This allows for systems with zfs built into the kernel manually to run these services. Otherwise the service will fail to start. Reviewed-by: loli10K <[email protected]> Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Thode <[email protected]> Closes #7174
* remove pools without a bootfs from BOOTFS variableMatthew Thode2018-01-302-2/+2
| | | | | | | | Use the same method used in zfs-load-key. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Llewelyn Trahaearn <[email protected]> Signed-off-by: Matthew Thode <[email protected]> Closes #7089
* Run zfs load-key if needed in dracutMatthew Thode2018-01-182-0/+2
| | | | | | | | | | | | | | | | 'zfs load-key -a' will only be called if needed. If a dataset not needed for boot does not have its key loaded (home directories for example) boot can still continue. zfs:AUTO was not working via dracut, so we still need the generator script to do its thing. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Manuel Amador (Rudd-O) <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: loli10K <[email protected]> Signed-off-by: Matthew Thode <[email protected]> Closes #6982 Closes #7004
* Cleanup systemd dependenciesAntonio Russo2017-11-087-7/+4
| | | | | | | | | | Some redundancy is present in the systemd dependencies, as noticed in PR#6764. Existing setups might rely on these quirks, so these cleanups have been moved to the development branch. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #6822
* systemd zfs-import.target and documentationAntonio Russo2017-10-305-6/+13
| | | | | | | | | | | | | | | | | zfs-import-{cache,scan}.service must complete before any mounting of filesystems can occur. To simplify this dependency, create a target that is reached After (in the systemd sense) the pool is imported. Additionally, recommend that legacy zfs mounts use the option x-systemd.requires=zfs-import.target to codify this requirement. Reviewed-by: Fabian Grünbichler <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #6764
* Add man page reference to systemd unitsFabian-Gruenbichler2017-09-054-0/+4
| | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Fabian Grünbichler <[email protected]> Closes #6599
* Disable mount(8) canonical paths in do_mount()LOLi2017-08-211-1/+0
| | | | | | | | | | | | | | | By default the mount(8) command, as invoked by 'zfs mount', will try to resolve any path parameter in its canonical form: this could lead to mount failures when the cwd contains a symlink having the same name of the dataset being mounted. Fix this by explicitly disabling mount(8) path canonicalization. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #1791 Closes #6429 Closes #6437
* Fix zfs-mount.service failure on bootBrian Behlendorf2017-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | The mount(8) command will helpfully try to resolve any device name which is passed in. It does this by applying some simple heuristics before passing it along to the registered mount helper. Normally this fine. However, one of these heuristics is to prepend the current working directory to the passed device name. If that resulting directory name exists mount(8) will perform the mount(2) system call and never invoke the helper utility. Since the cwd for systemd when running as the system instance is the root directory the default mount points created by zfs(8) can cause a mount failure. This change avoids the issue by explicitly setting the cwd to a different path when performing the mount. Signed-off-by: Brian Behlendorf <[email protected]> Closes #5719
* Fix zfs-share systemd unit fileLOLi2017-01-131-1/+1
| | | | | | | | Use the system /bin directory rather than the package install @bindir@. This allows --prefix=/usr/local to work as intended. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #5559
* Set proper dependency for string replacement targetsChunwei Chen2016-08-021-9/+2
| | | | | | | | | A lot of string replacement target don't have dependency or incorrect dependency. We setup proper dependency by pattern rules. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4908
* Systemd configuration fixesBrian Behlendorf2016-05-277-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disable zfs-import-scan.service by default. This ensures that pools will not be automatically imported unless they appear in the cache file. When this service is explicitly enabled pools will be imported with the "cachefile=none" property set. This prevents the creation of, or update to, an existing cache file. $ systemctl list-unit-files | grep zfs zfs-import-cache.service enabled zfs-import-scan.service disabled zfs-mount.service enabled zfs-share.service enabled zfs-zed.service enabled zfs.target enabled * Change services to dynamic from static by adding an [Install] section and adding 'WantedBy' tags in favor of 'Requires' tags. This allows for easier customization of the boot behavior. * Start the zfs-import-cache.service after the root pivot so the cache file is available in the standard location. * Start the zfs-mount.service after the systemd-remount-fs.service to ensure the root fs is writeable and the ZFS filesystems can create their mount points. * Change the default behavior to only load the ZFS kernel modules in zfs-import-*.service or when blkid(8) detects a pool. Users who wish to unconditionally load the kernel modules must uncomment the list of modules in /lib/modules-load.d/zfs.conf. Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4325 Closes #4496 Closes #4658 Closes #4699
* A collection of dracut fixesManuel Amador (Rudd-O)2016-05-122-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | - In older systems without sysroot.mount, import before dracut-mount, and re-enable old dracut mount hook - rootflags MUST be present even if the administrator neglected to specify it explicitly - Check that mount.zfs exists in sbindir - Remove awk and head as (now unused) requirements, add grep, and install the right mount.zfs - Eliminate one use of grep in Dracut - Use a more accurate grepping statement to identify zfsutil in rootflags - Ensure that pooldev is nonempty - Properly handle /dev/sd* devices and more - Use new -P to get list of zpool devices - Bail out of the generator when zfs:AUTO is on the root command line - Ignore errors from systemctl trying to load sysroot.mount, we only care about the output - Determine which one is the correct initqueuedir at run time. - Add a compatibility getargbool for our detection / setup script. - Update dracut .gitignore files Signed-off-by: <Matthew Thode [email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4558 Closes #4562
* Add nfs-kernel-server for DebianGrischa Zengel2016-02-251-2/+2
| | | | | | | | | | Debian based systems use nfs-kernel-server as the service name. List both nfs-server.service and nfs-kernel-server.service so this service will work on multiple distributions. Signed-off-by: Grischa Zengel <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4350
* Rename 'zed.service' to 'zfs-zed.service'Turbo Fredriksson2015-10-023-3/+6
| | | | | | | | | | | | | | | For consistency all systemd unit files and init scripts now share the same names. This prevents an issue where the zed is started twice on systems where both the systemd and sysv infrastructure is installed concurrently. For backward compatibility a 'zed' alias has been added. This allows the user to interact with the service using either the name 'zed' or 'zfs-zed'. Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #3837
* Support parallel build trees (VPATH builds)Turbo Fredriksson2015-07-171-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Build products from an out of tree build should be written relative to the build directory. Sources should be referred to by their locations in the source directory. This is accomplished by adding the 'src' and 'obj' variables for the module Makefile.am, using relative paths to reference source files, and by setting VPATH when source files are not co-located with the Makefile. This enables the following: $ mkdir build $ cd build $ ../configure \ --with-spl=$HOME/src/git/spl/ \ --with-spl-obj=$HOME/src/git/spl/build $ make -s This change also has the advantage of resolving the following warning which is generated by modern versions of automake. Makefile.am:00: warning: source file 'xxx' is in a subdirectory, Makefile.am:00: but option 'subdir-objects' is disabled Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1082
* Use ExecStartPre to load zfs modulesBrian Behlendorf2015-05-262-2/+4
| | | | | | | | | | | | | Commit 87abfcb broke the systemd import service by treating the ExecStart line as if it were a shell command that could be executed. This isn't the way systemd works and the correct way to handle this case is with ExecStartPre. This patch updates the zfs import service files accordingly, Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Steven Noonan <[email protected]> Signed-off-by: Chris Siebenmann <[email protected]> Closes #3440
* Wait in libzfs_init() for the /dev/zfs deviceBrian Behlendorf2015-05-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While module loading itself is synchronous the creation of the /dev/zfs device is not. This is because /dev/zfs is typically created by a udev rule after the module is registered and presented to user space through sysfs. This small window between module loading and device creation can result in spurious failures of libzfs_init(). This patch closes that race by extending libzfs_init() so it can detect that the modules are loaded and only if required wait for the /dev/zfs device to be created. This allows scripts to reliably use the following shell construct without the need for additional error handling. $ /sbin/modprobe zfs && /sbin/zpool import -a To minimize the potential time waiting in libzfs_init() a strategy similar to adaptive mutexes is employed. The function will busy-wait for up to 10ms based on the expectation that the modules were just loaded and therefore the /dev/zfs will be created imminently. If it takes longer than this it will fall back to polling for up to 10 seconds. This behavior can be customized to some degree by setting the following new environment variables. This functionality is provided for backwards compatibility with existing scripts which depend on the module auto-load behavior. By default module auto-loading is now disabled. * ZFS_MODULE_LOADING="YES|yes|ON|on" - Attempt to load modules. * ZFS_MODULE_TIMEOUT="<seconds>" - Seconds to wait for /dev/zfs The zfs-import-* systemd service files have been updated to call '/sbin/modprobe zfs' so they no longer rely on the legacy auto-loading behavior. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #2556
* Improve systemd script to not leave stale sharetabDan Swartzendruber2014-12-181-0/+1
| | | | | | | | | | The systemd script zfs-share.service does 'zfs share -a' to share any required datasets. Unfortunately, /etc/dfs/sharetab is stale from the previous boot. Delete it before we share. Signed-off-by: Dan Swartzendruber <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2883
* Fix systemd config for zfs-share.serviceDan Swartzendruber2014-11-191-0/+2
| | | | | | | | | | The zfs-share.service rule needs to be modified to ensure that it does not execute before zfs-mount.service. Signed-off-by: Dan Swartzendruber <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ralf Ertzinger <[email protected]> Closes #2893
* Import zfs pools after cryptsetupalteriks2014-09-042-0/+2
| | | | | | | | | | The zfs-import-cache.service and zfs-import-scan.service should should be started after cryptsetup to ensure all LUKS devices have been opened. Signed-off-by: alteriks <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1474
* Change startup mode of ZEDRalf Ertzinger2014-09-021-5/+1
| | | | | | | | | | | | Change the startup mode of ZED to non-forking. While systemd can track processes that detach from the terminal just fine, running processes in non-forking mode is the preferred mode of operation. Also remove user/group definitions as root/root is the default. Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2252