summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/set
Commit message (Collapse)AuthorAgeFilesLines
* geo-rep: gluster_shared_storage fails to automount on node reboot on rhel 8.Shwetha K Acharya2020-09-101-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | Issue: On reboot, all the mounts get wiped out. Only the mounts mentioned in /etc/fstab automatically gets mounted during boot/reboot. But /etc/fstab complains on not getting a canonical path (it gets path containing a symlink) This is because the gluster_shared_storage, is mounted to /var/run which is symlink to /run. This is a general practice followed by most operating systems. [root@ ~]# ls -lsah /var/run 0 lrwxrwxrwx. 1 root root 6 Jul 22 19:39 /var/run -> ../run Fix: Mount gluster_shared_storage on /run. (Also It is seen that /var/run is mostly used by old or legacy systems, thus it is a good practice to update /var/run to /run) fixes: #1459 Change-Id: I8c16653be8cd746c84f01abf0eea19284fb97c77 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glusterd: shared storage mount fails in ipv6 environmentnik-redhat2020-08-181-1/+8
| | | | | | | | | | | | | | | | | Issue: In case of ipv6 environment, the mounting of glusterd_shared_storage volume fails as it doesn't recognises the ipv6 enviornment. Fix: In case of ipv6 environment, the address-family is passed to the hooks script on creating shared-storage, then depending upon the address-family --xlator-option=transport.address-family=inet6 option is added to the mount command, and the mounting succeeds. Fixes: #1406 Change-Id: Ib1888c34d85e6c01618b0ba214cbe1f57576908d Signed-off-by: nik-redhat <nladha@redhat.com>
* extras/hooks: Remove smb.conf parameter allowing guest accessAnoop C S2019-12-101-1/+0
| | | | | | Change-Id: I88f494f16153d27ab6e2f2faf4d557e075671b10 Fixes: bz#1775612 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* gluster-smb:add smb parameter when access gluster by cifsyinkui2019-08-211-0/+1
| | | | | | Change-Id: I9ff54f2ca6f86bb5b2f4740485a0159e1fd7785f Fixes: bz#1741734 Signed-off-by: yinkui <13965432176@163.com>
* Do not blindly add volume share section to smb.confMilan Zink2018-12-041-2/+11
| | | | | | | | | | | | | With this change, by default GlusterFS volume share section will no longer be added to smb.conf for client access unless user.cifs or user.smb volume set options are enabled. This also fixes the hook script to check for presence of all configuration possibilities for those volume set options like 'enable' or 'on'. Change-Id: Ibecf7fffb4507d7255d963c3b1482afb0d0db984 Signed-off-by: Milan Zink <mzink@redhat.com> Signed-off-by: Anoop C S <anoopcs@redhat.com> Fixes: bz#1575836
* extras/hooks: Do not blindly remove volume share from smb.confAnoop C S2018-05-071-5/+6
| | | | | | | | | | | | | | | | | When Gluster volumes are shared via Samba, any extra smb.conf parameter setting done by administrator to those shares are lost during restart of the volume. Instead of removing the whole share completely from smb.conf(via hook scripts during volume stop) it is better to make it temporarily unavailable to end-users till the volume is started again. Therefore we make use of a smb.conf parameter named 'available'[1] to achieve the above intend. [1] https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html Change-Id: I68a9055b50791f6ffd3b95a3c13d858a75fa6530 fixes: bz#1558921 BUG: 1558921 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* build: add --without-server optionNiels de Vos2018-02-191-0/+2
| | | | | | | | | | | | | | | | With Gluster 4.0 we will not provide the server components for EL6 and older. At one point Gluster 4.x will get GlusterD2, which requires Golang tools in the distribution. EL6 does not contain these at the moment. With this change, it is possible to `./configure --without-server` which prevents building glusterd and the xlators for the bricks. Building RPMs can pass `--without server` and the glusterfs-server sub-package will not be created. Change-Id: I97f5ccf9f2c76e60d9af83915fc59fae57ad6d25 BUG: 1074947 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* extras/hooks: Fix getopt usageAnoop C S2017-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | `getopt` does not have an optional argument as '-name'. It should be either '-n' or '--name'(see man getopt(1)). This wrong usage resulted in setting the script name as 'ame' instead of $PROGNAME in most of the hook-scripts. Additionally the following line from DESCRIPTION given for `getopt` shell command expects short options for almost every kind of usage mentioned in SYNOPSIS: . . . If no '-o' or '--options' option is found in the first part, the first parameter of the second part is used as the short options string. . . . Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more clarity on its usage. Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* extras/hooks: Fix errors reported via shellcheck utilityAnoop C S2017-10-182-8/+8
| | | | | | Change-Id: I217c6b2a39955f1709bb3452b00d33c2dcb60faa BUG: 1500649 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* scripts: invalid test(1) in extras/S32gluster_enable_shared_storage.shKaleb S. KEITHLEY2017-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | test(1) man pages says -eq is for INTEGER compares, and = is for string compares. Also note the comment that -a and -o are ambiguous and to use test && test or test || test instead. This bug has existed since 2015! (yikes) Found while testing localtime logging and running glusterd in the foreground. Change-Id: Ia544f7295e247b981504d085ebc4c533ab60ba84 BUG: 1476785 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/17925 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
* build: use 'make install' to install the hook scriptsNiels de Vos2015-12-261-0/+3
| | | | | | | | | | | | | | | | | The installation should be the same on all distributions, and doing manual installation of files in the .spec is very ugly. This change adds the rules so that 'make install' places the hook scripts in the right location. Also, the hook script(s) for NFS-Ganesha should be part of the glusterfs-ganesha sub-package and got moved there. BUG: 1174765 Change-Id: Iba25a7a5112c7d40db4c10ff4a5ac7a5fb4f7c4e Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/13072 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* hook-scripts: fix S30Samba scripts on systemd systemsMichael Adam2015-12-171-1/+1
| | | | | | | | | | | | | | | | /etc/init.d/smb does not exist on systemd systems. Using "service smb <COMMAND>" is the portable way. It calls init scripts on sysv systems, and redirects to systemctl on systemd systems. Change-Id: I7146c9998a51d8b170d3321f3477e92704ae7615 BUG: 1290604 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-on: http://review.gluster.org/12945 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anoop C S <anoopcs@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* extras/hooks: Fix parsing of args in S30samba-set.shRaghavendra Talur2015-11-161-5/+9
| | | | | | | | | Change-Id: I75756f44757a144b0ed229fcc0e29a273fc75886 BUG: 1242892 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/11668 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* extra: "enable-shared-storage" key should create shared-storageGaurav Kumar Garg2015-07-131-1/+1
| | | | | | | | | | | | | | | Currently while creating shared storage it accept only "cluster.enable-shared-storage" key. It should also accept "enable-shared-storage" key. Change-Id: I4c68782f4b7927ec8cd725e411b0b9db17d9c48d BUG: 1238224 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/11491 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com>
* glusterd/shared_storage: Use /var/lib/glusterd/ss_brick as shared storage's ↵Avra Sengupta2015-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | brick The brick path we use to create shared storage is /var/run/gluster/ss_brick. The problem with using this brick path is /var/run/gluster is a tmpfs and all the brick/shared storage data will be wiped off when the node restarts. Hence using /var/lib/glusterd/ss_brick as the brick path for shared storage volume as this brick and the shared storage volume is internally created by us (albeit on user's request), and contains only internal state data and no user data. Change-Id: I808d1aa3e204a5d2022086d23bdbfdd44a2cfb1c BUG: 1218573 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11533 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
* gluster/shared_storage: Add/Remove shared storage from /etc/fstab during ↵Avra Sengupta2015-06-221-0/+5
| | | | | | | | | | | | | | | | enable/disable While creating/deleting shared storage volume, add/remove the shared storage entry from /etc/fstab, so as to ensure availability of the shared storage, even after a node reboot Change-Id: Ib9edc8fd02c74a677062ca53ffd10be997b056c6 BUG: 1231876 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11272 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
* NFS-Ganesha: Automatically export vol that was exported before vol restartMeghana M2015-06-162-291/+1
| | | | | | | | | | | | | | | | | | | | Consider a volume that is exported via NFS-Ganesha. Stopping this volume will automatically unexport the volume. Starting this volume should automatically export it. Although the logic was already there, there was a bug in it. Fixing the same by introducing a hook script. Also with the new CLI options, the hook script S31ganesha-set.sh is no longer required. Hence, removing the same. Adding a comment to tell the user that one of the CLI commands will take a few minutes to complete. Change-Id: Ibff769ca04fef0c2a129c83fe31fc9c869350e8d BUG: 1231738 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/11247 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* glusterd/shared_storage: Provide a volume set option to create and mount the ↵Avra Sengupta2015-06-042-1/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shared storage Introducing a global volume set option(cluster.enable-shared-storage) which helps create and set-up the shared storage meta volume. gluster volume set all cluster.enable-shared-storage enable On enabling this option, the system analyzes the number of peers in the cluster, which are currently connected, and chooses three such peers(including the node the command is issued from). From these peers a volume(gluster_shared_storage) is created. Depending on the number of peers available the volume is either a replica 3 volume(if there are 3 connected peers), or a replica 2 volume(if there are 2 connected peers). "/var/run/gluster/ss_brick" serves as the brick path on each node for the shared storage volume. We also mount the shared storage at "/var/run/gluster/shared_storage" on all the nodes in the cluster as part of enabling this option. If there is only one node in the cluster, or only one node is up then the command will fail Once the volume is created, and mounted the maintainance of the volume like adding-bricks, removing bricks etc., is expected to be the onus of the user. On disabling the option, we provide the user a warning, and on affirmation from the user we stop the shared storage volume, and unmount it from all the nodes in the cluster. gluster volume set all cluster.enable-shared-storage disable Change-Id: Idd92d67b93f444244f99ede9f634ef18d2945dbc BUG: 1222013 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10793 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
* extras/hookscripts: Fix set behaviour for user.cifs and user.smbRaghavendra Talur2014-11-111-12/+28
| | | | | | | | | | | | | | | Setting either of user.cifs or user.smb to disable should disable smb shares when the smb share is already available. Change-Id: I213ffca9cedc14107daeb30271d1f41dd9d7fcf4 BUG: 1105147 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/9042 Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
* Hook scripts should exit with correct exit status.Meghana Madhusudhan2014-08-312-9/+16
| | | | | | | | | | | | | | | | | | When volume set options other than nfs-ganesha.host and nfs-ganesha.enable are executed, the hook script S31ganesha-set.sh should exit with exit status 0. The present behaviour results in an error message in one of the logs that could be misleading. Similarly, hook script S30samba-set.sh should exit with exit status 0 if samba is not installed. Fixing the issue with a minor change in the script. Change-Id: I35d1dc8400bb7043385800ed97adc5321829437f BUG: 1122978 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8385 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* build: make GLUSTERD_WORKDIR rely on localstatedirHarshavardhana2014-08-072-44/+49
| | | | | | | | | | | | | | | | | | | | | | - Break-way from '/var/lib/glusterd' hard-coded previously, instead rely on 'configure' value from 'localstatedir' - Provide 's/lib/db' as default working directory for gluster management daemon for BSD and Darwin based installations - loff_t is really off_t on Darwin - fix-off the warnings generated by clang on FreeBSD/Darwin - Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all platforms. - Define proper environment for running tests, define correct PATH and LD_LIBRARY_PATH when running tests, so that the desired version of glusterfs is used, regardless where it is installed. (Thanks to manu@netbsd.org for this additional work) Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7 BUG: 1111774 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8246 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* gluster vol set nfs-ganesha.enable off fails to unexport volume.Meghana Madhusudhan2014-08-051-1/+1
| | | | | | | | | | | | | | | | | | Due to a parameter type change in upstream nfs-ganesha ( v2.1 and above ), gluster vol set <volname> nfs-ganesha.enable off doesn't unexport the volume in question if it was already exported. A minor change in the hook script would result in the expected behaviour. Change-Id: I46f76f3cde6b6ebd7a94d5ee16f05a3648a2840f BUG: 1124711 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8390 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Changing the position of nfs-ganesha.logMeghana Madhusudhan2014-07-091-1/+8
| | | | | | | | | | | | | | | Changing the position of ganesha.log from /tmp/ganesha.log to /var/log/nfs-ganesha/ganesha.nfsd.log Change-Id: Iff95fbc7fc690f4fdbc1789d84f3e41aaca9045b BUG: 1116723 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/8249 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/hookscripts: When set option disables smb, don't start smb.Raghavendra Talur2014-06-121-1/+1
| | | | | | | | | | | | | | When user.smb or user.cifs option is set to disable, we remove the share options from smb.conf. If smb process is running, a sighup is required but we should not start the process if its not running. Change-Id: I1e2163ff209ba858380f7da459ff1dba3cf673f2 BUG: 1105123 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7994 Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* Hooks/nfs-ganesha:Change the hook script to enable new function signature of ↵Meghana M2014-06-021-54/+56
| | | | | | | | | | | | | | | | | | | | add export. Minor changes in the hook script to avoid some possible confusion when volume set options are used. Adding a few additional checks to ensure correct behaviour. Edited a few config parameters that have changed in upstream ganesha recently. Change-Id: I85b842cbbd4b35b7f72f3beb60abf6532ddaa8c7 BUG: 1101416 Signed-off-by: Meghana M <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/7890 Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Hooks:Modified S31ganesha-set.sh to enable dynamic exports via NFS-ganeshaMeghana2014-05-161-59/+86
| | | | | | | | | | | | | | | | | | | | | | Dbus signals have to be sent to add and remove exports on the fly, without restarting nfs-ganesha server. Adding those signals in the hook script to enable the same. Adding another to check to enable IP modification, without restarting nfs-ganesha.Adding checks to find the configuration file in /etc/glusterfs-ganesha. Removing nested volume set options. This introduces some issues that will be documented clearly. Signed-off-by: Meghana <mmadhusu@redhat.com> Change-Id: I28f7983f2d18529dc813ddc9773b33c6caee1ad4 BUG: 1095656 Signed-off-by: Meghana <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/7709 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli/hooks : Add volume set options to enable/disable nfs-ganesha support.Meghana M2014-05-032-1/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. gluster volume set nfs-ganesha.enable ON/OFF If the option is set to ON, the volume field in the nfs-ganesha configuartion file is edited. Gluster-nfs is disabled on that volume and the volume is exported using nfs-ganesha. 2.gluster volume set nfs-ganesha.host IP This is used to provide the IP of the nfs-ganesha host. Note : nfs-ganesha.host MUST be set before using nfs-ganesha.enable ON The switch from gluster-nfs to nfs-ganesha is mostly done by the hook-scripts in the post phase of the 'set' option. As a result, gluster volume reset does not function as it is expected to. By default, nfs-ganesha will be set to off but the process will not be killed. Hence, a few changes have to be made post 'reset' option as well. Those changes also have been added. Change-Id: I7fdc14ee49d1724af96eda33c6a3ec08b1020788 BUG: 1092283 Signed-off-by: Meghana <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/7321 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/hookscripts: Remove %P from smb share path value.Raghavendra Talur2014-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We had added %P in the value for path in smb share definitions to avoid ctdb errors. However, %P does not work well for windows clients and they fail to access the share. Solution for the original problem: The error messages were being generated by a monitoring script that ctdb runs. The script reads the path value from testparm and tests if it exists in the local machine. This particular check does not hold valid for virtual file system backends like gluster. There is no harm in asking ctdb to not to check the existence of such backend and can be done by setting the following config in ctdb.conf: CTDB_SAMBA_SKIP_SHARE_CHECK=YES. Change-Id: I91627c8a279126a5cc24c6347847f9bfbad53dd5 BUG: 1068776 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7598 Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
* hook-scripts: Move smb hooks to right place.Raghavendra Talur2014-03-103-0/+129
Moved the hook-scripts to dirs corresponding to event. Also, edited S30samba-set.sh to with changes in other two hook scripts to bring uniformity. Change-Id: Ib98c0a18d4bb5d0ba4b881b2e19b40d72580b1c2 BUG: 1073468 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7201 Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Bala FA <barumuga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>