summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/stop/pre
Commit message (Collapse)AuthorAgeFilesLines
* extras/hooks: Honour all input arguments to scriptsAnoop C S2017-10-312-20/+28
| | | | | | | | | | | | | | | | | Some of the hook scripts were not honouring the arguments with which they are invoked during various volume operations. So make sure that we consider everything while parsing the command line arguments to avoid following warnings: . . . ame: unrecognized option '--first=no' ame: unrecognized option '--version=1' ame: unrecognized option '--volume-op=start' . . . Change-Id: I5b08e5e7f32908c8509e97098a042096b507783e BUG: 1503983 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* extras/hooks: Fix getopt usageAnoop C S2017-10-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | `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-6/+6
| | | | | | Change-Id: I217c6b2a39955f1709bb3452b00d33c2dcb60faa BUG: 1500649 Signed-off-by: Anoop C S <anoopcs@redhat.com>
* hook-scripts: remove RHS-2.0 reference from S29CTDB scriptsMichael Adam2016-01-111-1/+0
| | | | | | | | | | | | | This is old. And such downstream reference should not appear in upstream code. Change-Id: Ifa0664dae0fe5ac913a49afe2fefa43b0112b024 BUG: 1295505 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-on: http://review.gluster.org/13169 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
* 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>
* hook-scripts: don't let ctdb script change samba configMichael Adam2015-12-161-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several reasons why the behaviour in the hook scripts was bad: 1. A samba installation is clustered or non-clustered. That does not change because of the availability of the CTDB lock-volume. If the lock-volume is not available (and hence CTDB is not available or not healthy), then Samba won't be operational. But turning it into a non-clustered Samba-installation can in the worst case lead to data corruption if clients manage to access the same files (on share volumes). Hence 'clustering = yes/no' in Samba's config should not be touched. In particular, Samba should not be stopped/started by the hook script. If needed, then ctdb will take care of it. 2. Changing the idmap configuration is potentially dangerous as well. In particular the used tdb2 backend is legacy nowadays and should not be used any more in new installs. (I stems from the times when ctdb could not host persistent databases.) Changing the idmap can result in loss of access to files or in giving access to files where it is not intended. 3. The pattern used for detecting need for change is fragile. It may or may not play well possible manual changes to smb.conf. This change removes the parts that change the smb.conf file and start or stop Samba from the S29CTDB* hook scripts. Change-Id: I72f7aabafa8f089da4531fca2572a72c22825bcc BUG: 1290151 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-on: http://review.gluster.org/12930 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
* scripts: CTDB lockvol ping-timeout should be 10secsHarshavardhana2014-06-111-10/+15
| | | | | | | | | | | | | | | commit "4044e387dd40e2d12145fd32d5fd715406fcec8e" approach to this led to deadlocks instead we rely on an old trick at client side - without any need to modifying the volume globally. Change-Id: I6e3c6bf9c0a3a0dd99a51b5d2a6c1f050ed2384c BUG: 1091600 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8007 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* scripts: CTDB hooks should add `_netdev` for network mountsHarshavardhana2014-03-111-1/+1
| | | | | | | | | | | Change-Id: I86ad5e9ed291866a8d478768fb447e269f51c39e BUG: 1075182 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7221 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* hook-scripts: Move smb hooks to right place.Raghavendra Talur2014-03-103-0/+152
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>