I am using daemontools to start my application.

In the run script, I have something like exec taskset -c 2 [absolute path to my application]

But the problem is that one of the black box library my application expects it to run in a specific directory.

Now my question is how I can run my application in a specific directory without creating a subshell.


1 Answer 1


Just simply change the directory in the run script before you exec into the application. The current directory will be preserved across the exec call.

Something like the below in the run script:

cd /path/to/datadir
exec taskset -c 2 /path/to/bin/myapp
  • I swear it didn't work when I tried before posting. Now it works! Thanks!
    – HCSF
    Nov 8, 2018 at 6:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .