summaryrefslogtreecommitdiffstats
path: root/etc/init.d
Commit message (Collapse)AuthorAgeFilesLines
* Linux 3.1 compat, super_block->s_shrinkBrian Behlendorf2012-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux 3.1 kernel has introduced the concept of per-filesystem shrinkers which are directly assoicated with a super block. Prior to this change there was one shared global shrinker. The zfs code relied on being able to call the global shrinker when the arc_meta_limit was exceeded. This would cause the VFS to drop references on a fraction of the dentries in the dcache. The ARC could then safely reclaim the memory used by these entries and honor the arc_meta_limit. Unfortunately, when per-filesystem shrinkers were added the old interfaces were made unavailable. This change adds support to use the new per-filesystem shrinker interface so we can continue to honor the arc_meta_limit. The major benefit of the new interface is that we can now target only the zfs filesystem for dentry and inode pruning. Thus we can minimize any impact on the caching of other filesystems. In the context of making this change several other important issues related to managing the ARC were addressed, they include: * The dnlc_reduce_cache() function which was called by the ARC to drop dentries for the Posix layer was replaced with a generic zfs_prune_t callback. The ZPL layer now registers a callback to drop these dentries removing a layering violation which dates back to the Solaris code. This callback can also be used by other ARC consumers such as Lustre. arc_add_prune_callback() arc_remove_prune_callback() * The arc_reduce_dnlc_percent module option has been changed to arc_meta_prune for clarity. The dnlc functions are specific to Solaris's VFS and have already been largely eliminated already. The replacement tunable now represents the number of bytes the prune callback will request when invoked. * Less aggressively invoke the prune callback. We used to call this whenever we exceeded the arc_meta_limit however that's not strictly correct since it results in over zeleous reclaim of dentries and inodes. It is now only called once the arc_meta_limit is exceeded and every effort has been made to evict other data from the ARC cache. * More promptly manage exceeding the arc_meta_limit. When reading meta data in to the cache if a buffer was unable to be recycled notify the arc_reclaim thread to invoke the required prune. * Added arcstat_prune kstat which is incremented when the ARC is forced to request that a consumer prune its cache. Remember this will only occur when the ARC has no other choice. If it can evict buffers safely without invoking the prune callback it will. * This change is also expected to resolve the unexpect collapses of the ARC cache. This would occur because when exceeded just the arc_meta_limit reclaim presure would be excerted on the arc_c value via arc_shrink(). This effectively shrunk the entire cache when really we just needed to reclaim meta data. Signed-off-by: Brian Behlendorf <[email protected]> Closes #466 Closes #292
* Linux 3.2 compat: set_nlink()Darik Horn2011-12-161-0/+1
| | | | | | | | | | | Directly changing inode->i_nlink is deprecated in Linux 3.2 by commit SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170 Use the new set_nlink() kernel function instead. Signed-off-by: Brian Behlendorf <[email protected]> Closes: #462
* Add make rule for building Arch Linux packagesPrakash Surya2011-12-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the necessary build infrastructure for building packages compatible with the Arch Linux distribution. As such, one can now run: $ ./configure $ make pkg # Alternatively, one can run 'make arch' as well on the Arch Linux machine to create two binary packages compatible with the pacman package manager, one for the zfs userland utilities and another for the zfs kernel modules. The new packages can then be installed by running: # pacman -U $package.pkg.tar.xz In addition, source-only packages suitable for an Arch Linux chroot environment or remote builder can also be build using the 'sarch' make rule. NOTE: Since the source dist tarball is created on the fly from the head of the build tree, it's MD5 hash signature will be continually influx. As a result, the md5sum variable was intentionally omitted from the PKGBUILD files, and the '--skipinteg' makepkg option is used. This may or may not have any serious security implications, as the source tarball is not being downloaded from an outside source. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #491
* Quote variables in the zfs.lsb script.Darik Horn2011-12-051-16/+16
| | | | | | | | | For consistency and safety, quote all variables in the zfs.lsb script. This protects in the unlikely case that any of the file names contain whitespace. Signed-off-by: Brian Behlendorf <[email protected]> Issue #439
* Source /etc/default/zfs after setting defaults.Darik Horn2011-12-051-5/+3
| | | | | | | | | | | Let the administrator override all script variables by sourcing the /etc/default/zfs file after the default values are set. The spelling mistake in the old path name makes it unlikely that this bug affected any users. Signed-off-by: Brian Behlendorf <[email protected]> Closes: #371
* Simplify BDI integrationBrian Behlendorf2011-11-081-0/+1
| | | | | | | | | | | | | | Update the code to use the bdi_setup_and_register() helper to simplify the bdi integration code. The updated code now just registers the bdi during mount and destroys it during unmount. The only complication is that for 2.6.32 - 2.6.33 kernels the helper wasn't available so in these cases the zfs code must provide it. Luckily the bdi_setup_and_register() function is trivial. Signed-off-by: Brian Behlendorf <[email protected]> Closes #367
* Use automatic variable in MakefileNed Bass2011-09-262-2/+2
| | | | | | | | | | | As written, the $(init_SCRIPTS) rule in etc/init.d/Makefule.am would not work as expected if the init_SCRIPTS variable were to contain any elements other than zfs. Fix this by replacing the hard-coded 'zfs' reference with $@. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #410
* Fix incorrect zpool_cache substitutionBrian Behlendorf2011-08-226-6/+6
| | | | | | | | | | This regression was accidentally introduced by commit aa2b489. I was attempting to simplify the init scripts and accidentally confused the /etc/init.d and /etc/zfs paths. This change reverts the init script modifications. Signed-off-by: Brian Behlendorf <[email protected]> Closes #370
* Fix autoconf variable substitution in init scripts.Brian Behlendorf2011-08-199-53/+128
| | | | | | | | Change the variable substitution in the init script templates according to the method described in the Autoconf manual; Chapter 4.7.2: Installation Directory Variables. Signed-off-by: Brian Behlendorf <[email protected]>
* Autogen refresh for udev changesBrian Behlendorf2011-08-081-0/+3
| | | | | | | | Run autogen.sh using the same autotools versions as upstream: * autoconf-2.63 * automake-1.11.1 * libtool-2.2.6b
* Add backing_device_info per-filesystemBrian Behlendorf2011-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a long time now the kernel has been moving away from using the pdflush daemon to write 'old' dirty pages to disk. The primary reason for this is because the pdflush daemon is single threaded and can be a limiting factor for performance. Since pdflush sequentially walks the dirty inode list for each super block any delay in processing can slow down dirty page writeback for all filesystems. The replacement for pdflush is called bdi (backing device info). The bdi system involves creating a per-filesystem control structure each with its own private sets of queues to manage writeback. The advantage is greater parallelism which improves performance and prevents a single filesystem from slowing writeback to the others. For a long time both systems co-existed in the kernel so it wasn't strictly required to implement the bdi scheme. However, as of Linux 2.6.36 kernels the pdflush functionality has been retired. Since ZFS already bypasses the page cache for most I/O this is only an issue for mmap(2) writes which must go through the page cache. Even then adding this missing support for newer kernels was overlooked because there are other mechanisms which can trigger writeback. However, there is one critical case where not implementing the bdi functionality can cause problems. If an application handles a page fault it can enter the balance_dirty_pages() callpath. This will result in the application hanging until the number of dirty pages in the system drops below the dirty ratio. Without a registered backing_device_info for the filesystem the dirty pages will not get written out. Thus the application will hang. As mentioned above this was less of an issue with older kernels because pdflush would eventually write out the dirty pages. This change adds a backing_device_info structure to the zfs_sb_t which is already allocated per-super block. It is then registered when the filesystem mounted and unregistered on unmount. It will not be registered for mounted snapshots which are read-only. This change will result in flush-<pool> thread being dynamically created and destroyed per-mounted filesystem for writeback. Signed-off-by: Brian Behlendorf <[email protected]> Closes #174
* Add .gitignore for zfs.<distro> init scriptsBrian Behlendorf2011-08-011-0/+6
| | | | | | Treat the automatically generated zfs.<distro> init scripts as build products by adding them to a directory specific .gitignore file.
* Turn the init.d scripts into autoconf config filesKyle Fuller2011-08-017-34/+60
| | | | | | | | | | This change ensures the paths used by the provided init scripts always reference the prefixes provided at configure time. The @sbindir@ and @sysconfdir@ prefixes will be correctly replaced at build time. Signed-off-by: Brian Behlendorf <[email protected]> Closes #336
* Provide a rc.d script for archlinuxzfs-0.6.0-rc5Kyle Fuller2011-07-113-4/+63
| | | | | | | | | | | Unlike most other Linux distributions archlinux installs its init scripts in /etc/rc.d insead of /etc/init.d. This commit provides an archlinux rc.d script for zfs and extends the build infrastructure to ensure it get's installed in the correct place. Signed-off-by: Brian Behlendorf <[email protected]> Closes #322
* Check for "udevadm settle" vs "udevsettle"Fajar A. Nugraha2011-07-081-1/+5
| | | | | | | RHEL5 does not have udevadm, so fix initscript accordingly Signed-off-by: Brian Behlendorf <[email protected]> Closes #315
* Updated init scripts to enable automatic sharing of ZFS datasets.Gunnar Beutner2011-07-065-0/+25
| | | | | | | The relevant init scripts were updated so as to automatically share ZFS datasets using "zfs share -a" at boot time. Signed-off-by: Brian Behlendorf <[email protected]>
* Update zfs.gentoo/zfs.lsb init scriptZachary Bedell2011-07-062-11/+11
| | | | | | | | | * Update paths to zpool/zfs tools, * Log less for non-error conditions, * Don't be fatal if umount fails at shutdown -- final init remount will take care of it if /usr or / are in use Signed-off-by: Brian Behlendorf <[email protected]>
* Removed erroneous backticks in the zfs.lunar init script.Gunnar Beutner2011-07-051-2/+2
| | | | | | | | The backticks would cause the output of the zfs commands to be evaluated as input for the if construct rather than their exit status. Signed-off-by: Brian Behlendorf <[email protected]>
* Fixed indentation in the zfs.lunar init script.Gunnar Beutner2011-07-051-10/+10
| | | | | | One of the blocks in the init script wasn't indented properly. Signed-off-by: Brian Behlendorf <[email protected]>
* Fix 'rc_parallel="YES"' errorAndrew Tselischev2011-07-041-1/+1
| | | | | | | | If rc_parallel="YES" zfs starts before localmount, which leads to "No such file or directory" error on systems with /usr on a separate partition. Signed-off-by: Brian Behlendorf <[email protected]>
* Linux compat 2.6.39: mount_nodev()Brian Behlendorf2011-07-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .get_sb callback has been replaced by a .mount callback in the file_system_type structure. When using the new interface the caller must now use the mount_nodev() helper. Unfortunately, the new interface no longer passes the vfsmount down to the zfs layers. This poses a problem for the existing implementation because we currently save this pointer in the super block for latter use. It provides our only entry point in to the namespace layer for manipulating certain mount options. This needed to be done originally to allow commands like 'zfs set atime=off tank' to work properly. It also allowed me to keep more of the original Solaris code unmodified. Under Solaris there is a 1-to-1 mapping between a mount point and a file system so this is a fairly natural thing to do. However, under Linux they many be multiple entries in the namespace which reference the same filesystem. Thus keeping a back reference from the filesystem to the namespace is complicated. Rather than introduce some ugly hack to get the vfsmount and continue as before. I'm leveraging this API change to update the ZFS code to do things in a more natural way for Linux. This has the upside that is resolves the compatibility issue for the long term and fixes several other minor bugs which have been reported. This commit updates the code to remove this vfsmount back reference entirely. All modifications to filesystem mount options are now passed in to the kernel via a '-o remount'. This is the expected Linux mechanism and allows the namespace to properly handle any options which apply to it before passing them on to the file system itself. Aside from fixing the compatibility issue, removing the vfsmount has had the benefit of simplifying the code. This change which fairly involved has turned out nicely. Closes #246 Closes #217 Closes #187 Closes #248 Closes #231
* Linux compat 2.6.39: security_inode_init_security()Brian Behlendorf2011-07-011-0/+1
| | | | | | | | | | | The security_inode_init_security() function now takes an additional qstr argument which must be passed in from the dentry if available. Passing a NULL is safe when no qstr is available the relevant security checks will just be skipped. Closes #246 Closes #217 Closes #187
* Ensure all block devices are availableBrian Behlendorf2011-06-305-0/+16
| | | | | | | | | | | | | These days most disk drivers will probe for devices asynchronously. This means it's possible that when you zfs init script runs all the required block devices may not yet have been discovered. The result is the pool may fail to cleanly import at boot time. This is particularly common when you have a large number of devices. The fix is for the init script to block until udev settles and we are no longer detecting new devices. Once the system has settled the zfs modules can be loaded and the pool with be automatically imported.
* Tear down and flush the mmap regionPrasad Joshi2011-06-271-0/+1
| | | | | | | | | | | | | | The inode eviction should unmap the pages associated with the inode. These pages should also be flushed to disk to avoid the data loss. Therefore, use truncate_setsize() in evict_inode() to release the pagecache. The API truncate_setsize() was added in 2.6.35 kernel. To ensure compatibility with the old kernel, the patch defines its own truncate_setsize function. Signed-off-by: Prasad Joshi <[email protected]> Closes #255
* Always check -Wno-unused-but-set-variable gcc supportBrian Behlendorf2011-06-141-1/+1
| | | | | | | | | | | The previous commit 8a7e1ceefa430988c8f888ca708ab307333b4464 wasn't quite right. This check applies to both the user and kernel space build and as such we must make sure it runs regardless of what the --with-config option is set too. For example, if --with-config=kernel then the autoconf test does not run and we generate build warnings when compiling the kernel packages.
* Check for -Wno-unused-but-set-variable gcc supportBrian Behlendorf2011-06-141-0/+2
| | | | | | | | | | | | | Gcc versions 4.3.2 and earlier do not support the compiler flag -Wno-unused-but-set-variable. This can lead to build failures on older Linux platforms such as Debian Lenny. Since this is an optional build argument this changes add a new autoconf check for the option. If it is supported by the installed version of gcc then it is used otherwise it is omited. See commit's 12c1acde76683108441827ae9affba1872f3afe5 and 79713039a2b6e0ed223d141b4a8a8455f282d2f2 for the reason the -Wno-unused-but-set-variable options was originally added.
* Remove root 'ls' after mount workaroundAlexey Shvetsov2011-05-122-20/+0
| | | | | | This workaround was introduced to workaround issue #164. This issue was fixed by commit 5f35b19 so the workaround can be safely dropped from both the zfs.fedora and zfs.gentoo init scripts.
* Fix zfs.gentoo init script logicAlexey Shvetsov2011-05-121-1/+2
| | | | | * Fix zfs.ko module check * Check 'zfs umount -a' return value
* Make zfs.gentoo init script more gentoo style.Alexey Shvetsov2011-05-121-72/+29
| | | | | | | | * Improved compatibility with openrc * Removed LOCKFILE * Improved checksystem() function * Remove /etc/mtab check for / * General cleanup
* Add Gentoo/Lunar/Redhat Init ScriptsBrian Behlendorf2011-05-025-2/+399
| | | | | | | | | | | | Every distribution has slightly different requirements for their init scripts. Because of this the zfs package contains several init scripts for various distributions. These scripts have been contributed by, and are supported by, the larger zfs community. Init scripts for Gentoo/Lunar/Redhat have been contributed by: Gentoo - devsk <[email protected]> Lunar - Jean-Michel Bruenn <[email protected]> Redhat - Fajar A. Nugraha <[email protected]>
* Fix 'zfs set volsize=N pool/dataset'Brian Behlendorf2011-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes a kernel panic which would occur when resizing a dataset which was not open. The objset_t stored in the zvol_state_t will be set to NULL when the block device is closed. To avoid this issue we pass the correct objset_t as the third arg. The code has also been updated to correctly notify the kernel when the block device capacity changes. For 2.6.28 and newer kernels the capacity change will be immediately detected. For earlier kernels the capacity change will be detected when the device is next opened. This is a known limitation of older kernels. Online ext3 resize test case passes on 2.6.28+ kernels: $ dd if=/dev/zero of=/tmp/zvol bs=1M count=1 seek=1023 $ zpool create tank /tmp/zvol $ zfs create -V 500M tank/zd0 $ mkfs.ext3 /dev/zd0 $ mkdir /mnt/zd0 $ mount /dev/zd0 /mnt/zd0 $ df -h /mnt/zd0 $ zfs set volsize=800M tank/zd0 $ resize2fs /dev/zd0 $ df -h /mnt/zd0 Original-patch-by: Fajar A. Nugraha <[email protected]> Closes #68 Closes #84
* Implemented NFS export_operations.Gunnar Beutner2011-04-291-0/+1
| | | | | Implemented the required NFS operations for exporting ZFS datasets using the in-kernel NFS daemon.
* Added required runlevel info for init on DebianAniruddha Shankar2011-04-201-0/+2
| | | | | Signed-off-by: Brian Behlendorf <[email protected]> Closes #208
* Autogen refresh for kernel-insert-inode-locked.m4Brian Behlendorf2011-04-181-0/+1
| | | | | | Several Makefile.in's were accidentally not updated when the kernel-insert-inode-locked.m4 check was added. This change simply refreshes the missed files.
* Update zfs.fedora init scriptManuel Amador (Rudd-O)2011-04-071-51/+178
| | | | | | | | | | | | | | Apply all of Rudd-O's changes for the Fedora init script. The initial init script was one I threw together based on Rudd-O's original work. It worked for me but it has some flaws. Rudd-O has invested considerable time updating it to be significantly smarter. It now handles using ZFS as your root filesystem plus various other quirks. Since he is familiar with the right way to do things on Fedora and has tested this init script we are integrating all of his changes. Signed-off-by: Brian Behlendorf <[email protected]>
* Add init scriptsBrian Behlendorf2011-03-174-0/+697
To support automatically mounting your zfs on filesystem on boot a basic init script is needed. Unfortunately, every distribution has their own idea of the _right_ way to do things. Rather than write one very complicated portable init script, which would be invariably replaced by the distributions own anyway. I have instead added support to provide multiple distribution specific init scripts. The correct init script for your distribution will be selected by ZFS_AC_DEFAULT_PACKAGE which will set DEFAULT_INIT_SCRIPT. During 'make install' the correct script for your system will be installed from zfs/etc/init.d/zfs.DEFAULT_INIT_SCRIPT to the usual /etc/init.d/zfs location. Currently, there is zfs.fedora and a more generic zfs.lsb init script. Hopefully, the distribution maintainers who know best how they want their init scripts to function will feedback their approved versions to be included in the project. This change does not consider upstart jobs but I'm not at all opposed to add that sort of thing.