Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Erwan Velu <erwan@enovance.com>
To: fio@vger.kernel.org
Subject: Question about exec_string()
Date: Tue, 16 Jul 2013 09:19:18 +0200	[thread overview]
Message-ID: <51E4F3F6.3030808@enovance.com> (raw)

Hi,

I'm continuing my experiments with fio and adding features to genfio.
I'm currently adding to genfio the exec_{pre|post}run support.

I'm benching some ceph and so need to reset OSD's caches with echoing in 
drop_cache.
To achieve that, I'm using kash (from kanif) and having the following 
syntaxt :

kash -n m1sw1 -n m1sw2 -n m1sw3 -n m2sw1 -n m2sw3 -- echo 3 > 
/proc/sys/vm/drop_caches

To be able to ssh all this nodes, I need my env to be kept as it relies 
on my ssh-agent.
That's where I do my troubles.

exec_prerun uses exec_string() with does a "sh -c %s'". That does loose 
my env and prevents me from executing my command.

I've been testing by removing the "sh -c" and only keep "%s" which works 
perfectly.
I'm so wondering what was the targeted role of executing sh instead of 
running the command directly.
If you agree about this change, I can provide the patch.

Note also it would be lovely to have an explicit redirection of the 
output as unless it's pretty hard to understand if the command got run 
with its associated output.

Cheers,
Erwan

             reply	other threads:[~2013-07-16  7:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  7:19 Erwan Velu [this message]
2013-07-16 20:58 ` Question about exec_string() Jens Axboe
2013-07-16 21:01   ` Erwan Velu
2013-07-16 21:13     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E4F3F6.3030808@enovance.com \
    --to=erwan@enovance.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox