1

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.

Thanks.

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:

#!/bin/sh
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 '18 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.