Re: [Linux-ha-dev] [RfC] [Patch] Filesystem
On Mon, Feb 20, 2012 at 9:40 PM, Lars Ellenberg lars.ellenb...@linbit.com wrote: What do you say? +1 Florian -- Need help with High Availability? http://www.hastexo.com/now ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
[Linux-ha-dev] [PATCH] hb_report fails to sudo
Hi, hb_report in cluster-glue-1.0.8 or later fails on an error even if it runs as root, at least on RHEL: --- # id -u 0 # hb_report -f 16:00 report1 sudo: sorry, you must have a tty to run sudo (...) --- It seems introduced by this changeset: http://hg.linux-ha.org/glue/rev/f55d68c37426 Apparently two issues are involved: 1) it tries to use sudo even when invoked as root. 2) sudo may be prohibited without tty on some distros such as RHEL for a security sake. The attached patch would fix for 1). You can workaround it by specifying '-u root' explicitly until it gets fixed. As for 2), it seems that the current hb_report need to _disable_ tty on ssh, so you would need an additional configuration to /etc/sudoers on such distros if you want to use a regular user to ssh. Regards, -- Keisuke MORI hb_report-sudo-root.patch Description: Binary data ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
Re: [Linux-ha-dev] [PATCH] hb_report fails to sudo
Hi Keisuke-san, On Tue, Feb 21, 2012 at 09:39:52PM +0900, Keisuke MORI wrote: Hi, hb_report in cluster-glue-1.0.8 or later fails on an error even if it runs as root, at least on RHEL: --- # id -u 0 # hb_report -f 16:00 report1 sudo: sorry, you must have a tty to run sudo Hmpf. (...) --- It seems introduced by this changeset: http://hg.linux-ha.org/glue/rev/f55d68c37426 Apparently two issues are involved: 1) it tries to use sudo even when invoked as root. 2) sudo may be prohibited without tty on some distros such as RHEL for a security sake. The attached patch would fix for 1). Patch applied. You can workaround it by specifying '-u root' explicitly until it gets fixed. As for 2), it seems that the current hb_report need to _disable_ tty on ssh, so you would need an additional configuration to /etc/sudoers on such distros if you want to use a regular user to ssh. Perhaps hb_report doesn't need to disable tty allocation, but I thought it would be better so since it runs as a batch program (also invoked from hb_gui or hawk). I think it was like that since the beginning but I'll take a look again. Many thanks for the patch! Cheers, Dejan Regards, -- Keisuke MORI ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/ ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
Re: [Linux-ha-dev] [RfC] [Patch] Filesystem
Hi Lars, On Mon, Feb 20, 2012 at 09:40:22PM +0100, Lars Ellenberg wrote: What do you say? Yes, please go ahead and apply this. Cheers, Dejan commit e57f9f7a7b8f838e750864ce332436a0f36321d7 Author: Lars Ellenberg lars.ellenb...@linbit.com Date: Mon Feb 20 20:38:49 2012 +0100 Medium: Filesystem: improve read/write checks for CHECK_LEVEL 10, 20 Some devices don't support 512 byte direct writes anymore, the physical block size is 4kByte. Changing bs=512 count=16 to bs=4k count=1 also helps to avoid spurious timeouts. I've seen badly tuned (and/or totally overloaded) IO stacks exposing a synchronous single-request IO latency of many seconds (under load). If we need 16 of those, we can easily violate timeout settings. diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem index a31931b..5f1ecfe 100755 --- a/heartbeat/Filesystem +++ b/heartbeat/Filesystem @@ -837,7 +837,7 @@ Filesystem_monitor_10() ocf_log warn $DEVICE is not a block device, monitor 10 is noop return $OCF_SUCCESS fi - dd_opts=iflag=direct bs=512 count=16 + dd_opts=iflag=direct bs=4k count=1 err_output=`dd if=$DEVICE $dd_opts 21 /dev/null` if [ $? -ne 0 ]; then ocf_log err Failed to read device $DEVICE @@ -853,11 +853,11 @@ Filesystem_monitor_20() { if [ $blockdevice = no ] ; then # O_DIRECT not supported on cifs/smbfs - dd_opts=oflag=sync bs=512 conv=fsync,sync + dd_opts=oflag=sync bs=4k conv=fsync,sync else # Writing to the device in O_DIRECT mode is imperative # to bypass caches. - dd_opts=oflag=direct,sync bs=512 conv=fsync,sync + dd_opts=oflag=direct,sync bs=4k conv=fsync,sync fi status_dir=`dirname $STATUSFILE` [ -d $status_dir ] || ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/ ___ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/