# Add \`nice -19\` worker process

**URL:** https://discourse.julialang.org/t/add-nice-19-worker-process/14471
**Category:** General Usage
**Tags:** parallel
**Created:** [September 3, 2018, 10:35am UTC](https://discourse.julialang.org/t/add-nice-19-worker-process/14471 "2018-09-03T10:35:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [September 3, 2018, 10:35am UTC](https://discourse.julialang.org/t/add-nice-19-worker-process/14471/1 "2018-09-03T10:35:28Z")

</div>

I want to start a worker process on a different node with a certain [niceness](https://en.wikipedia.org/wiki/Nice_(Unix)).

Basically, I want to prepend the command generated by `addprocs(["mynode"])` with `nice -19`.

As has suggested to me on Slack, there is the `exename` keyword argument for [addprocs](https://docs.julialang.org/en/v0.6.4/stdlib/parallel/#Base.Distributed.addprocs). However, this seems to get `Base.shell_escape`d and what I effectively get is `cmd = `'nice -19 julia'`` instead of `cmd = `nice -19 julia`` which will lead to a bash error (`No such file or directory`).

Any ideas how to solve this?

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [September 3, 2018, 10:47am UTC](https://discourse.julialang.org/t/add-nice-19-worker-process/14471/2 "2018-09-03T10:47:08Z")

</div>

You used a `String` I guess? Try using a `Cmd` object:

```julia
julia> using Distributed

julia> addprocs(1, exename = `nice -19 julia`)
1-element Array{Int64,1}:
 2

```

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [September 3, 2018, 10:57am UTC](https://discourse.julialang.org/t/add-nice-19-worker-process/14471/3 "2018-09-03T10:57:46Z")

</div>

That works, thanks!
