[daemon] Get the path of the executable correctly