diff options
author | Martin Schwenke <martin@meltin.net> | 2011-01-11 17:06:48 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2011-01-11 16:47:43 +1100 |
commit | 934ae76d38d1c847dccd79cf474d90286bb0bec8 (patch) | |
tree | 77af5b27df3413620b719aa1a411f79849e97be8 | |
parent | 47aad746735d016fef838694b74e22374de99246 (diff) | |
download | samba-934ae76d38d1c847dccd79cf474d90286bb0bec8.tar.gz samba-934ae76d38d1c847dccd79cf474d90286bb0bec8.tar.xz samba-934ae76d38d1c847dccd79cf474d90286bb0bec8.zip |
Eventscripts: work around NFS restart failure under load.
"service nfs restart" can fail. To stop nfsd it sends a SIGINT and
nfsd might take a while to process it if the system is loaded.
Starting nfsd may then fail because resources are still in use.
This does some /proc magic to tell nfsd to do no more processing. It
then runs service stop, kills nfsd with SIGKILL, and then runs service
start. This is much less likely to fail.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a9bf4f82852975b0b627f61ceb2d23401f630805)
-rwxr-xr-x | ctdb/config/functions | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions index 4dc645b798..599e46a5f3 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -375,7 +375,10 @@ startstop_nfs() { service nfsserver stop > /dev/null 2>&1 ;; restart) - service nfsserver restart + echo 0 >/proc/fs/nfsd/threads + service nfsserver stop > /dev/null 2>&1 + pkill -9 nfsd + service nfsserver start ;; esac ;; @@ -390,8 +393,12 @@ startstop_nfs() { service nfslock stop > /dev/null 2>&1 ;; restart) - service nfslock restart - service nfs restart + echo 0 >/proc/fs/nfsd/threads + service nfs stop > /dev/null 2>&1 + service nfslock stop > /dev/null 2>&1 + pkill -9 nfsd + service nfslock start + service nfs start ;; esac ;; |