summaryrefslogtreecommitdiffstats
path: root/etc/systemd
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add systemd unit file for zedChris Dunlap2014-04-023-2/+20
| | | | | | | | | | This commit adds a systemd unit file for zed.service and integrates it into the zfs.target from commit 881f45c. Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2108 Issue #2
* Add systemd unit files for ZFS startupRalf Ertzinger2014-02-059-0/+92
This adds systemd unit files replacing the functionality offered by the SysV init script found in etc/init.d. It has been developed and tested on Fedora 19, Fedora 20 and openSuSE 13.1. Four unit files and one target are offered. zfs-import-cache.service: Import pools from /etc/zfs/zpool.cache. This unit will wait for udev to settle. zfs-import-scan.service: Import pools by scanning /dev/disk/by-id for zvols. This unit will only run if /etc/zfs/zpool.cache is not present. This unit will wait for udev to settle zfs-mount.service: Mount ZFS native filesystems. It contains a dependency to be loaded before local-fs.target. zfs-share.service: Share NFS/SMB filesystems. This unit contains a dependency that will cause it to be restarted whenever the smb or nfs-server unit is restarted, restoring the shares added. zfs.target: This target pulls in the other units in order to start ZFS. It's the only unit that can be enabled/disabled, all other services are static and pulled in by dependencies. It will honour zfs=off and zfs=no options on the kernel command line. Signed-off-by: Brian Behlendorf <[email protected]> Closes #2108