# Problem in running the command with '&'   ("/opt/medusa\_labs/test\_tools/bin/maim -b256k -Q8 -f/dev/sdc &")

**URL:** <https://forum.ansible.com/t/problem-in-running-the-command-with-opt-medusa-labs-test-tools-bin-maim-b256k-q8-f-dev-sdc/21494>\
**Category:** Ansible Project\
**Created:** [May 19, 2016, 5:16pm UTC](https://forum.ansible.com/t/problem-in-running-the-command-with-opt-medusa-labs-test-tools-bin-maim-b256k-q8-f-dev-sdc/21494 "2016-05-19T17:16:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aprameya\_NDS](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Aprameya\_NDS](https://forum.ansible.com/u/Aprameya_NDS)\
**Post date:** [May 19, 2016, 5:16pm UTC](https://forum.ansible.com/t/problem-in-running-the-command-with-opt-medusa-labs-test-tools-bin-maim-b256k-q8-f-dev-sdc/21494/1 "2016-05-19T17:16:52Z")

</div>

Hi,

I have a traffic tool for which i have written a module with the required options which i send to be triggered through Ansible for execution.

It goes this way:

“/opt/medusa\_labs/test\_tools/bin/maim -b256k -Q8 -f/dev/sdc &”

When executing on the host i get the following error: “**(program startup error)\n\nERROR: INIT: ‘&’ is an unrecognized command line parameter\n"}**”

Here ‘&’ is being taken as an option rather than telling it to run as a background. Manually running the same command on the host works fine.

The reason for going with this approach is that Async and Poll when used, log files do not get created by the traffic tool and when run without this its a kind of infinite command which runs for ever.

So can anyone please give some suggestions/ideas on the approach that can solve this?

Regards  
Aprameya

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 19, 2016, 5:22pm UTC](https://forum.ansible.com/t/problem-in-running-the-command-with-opt-medusa-labs-test-tools-bin-maim-b256k-q8-f-dev-sdc/21494/2 "2016-05-19T17:22:15Z")

</div>

If you are using the `command` module, this is because `command` doesn’t understand shell constructs such as `&`

You would need to use the `shell` module instead.

However, you are still likely to have issues with this. The command will still likely end before you expect. I’d really recommend creating a real service that can start and potentially monitor this command more appropriately.

---

<div class="post-metadata">

**Author:** ![Aprameya\_NDS](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Aprameya\_NDS](https://forum.ansible.com/u/Aprameya_NDS)\
**Post date:** [May 19, 2016, 5:33pm UTC](https://forum.ansible.com/t/problem-in-running-the-command-with-opt-medusa-labs-test-tools-bin-maim-b256k-q8-f-dev-sdc/21494/3 "2016-05-19T17:33:30Z")

</div>

Thanks Matt

Regards  
Aprameya
