Universal Robots Forum

Is it possible to pass arguments the daemon executable?

I would like to set the log level of the daemon to a value defined by the operator but I have not found a way to do it. I tried appending a parameter at the end of the executable url but that does not work. I also tried using query parameters to the url but that does not work either.

@poproulx, I am not quite sure I follow your idea.
Can you please elaborate?

From URScript, you could open a socket connection to a daemon (which acts as a server, and monitors the socket), and then pass a variable to the daemon.
Is this what you are looking for?

Let say a daemon takes arguments on the command line. For example, if my daemon has to open a port (–port 1234) or if I can start it in debug mode (–debug), I don’t see how to pass those parameters to the daemon. In the getExecutable callback from the DaemonService, I can only pass an executable name. I did not find how to pass arguments to that executable. Without being able to pass arguments to the daemon, it makes it difficult to start a daemon in a certain configuration determined by the URCap.

That is not possible.
From Java you can only run the start()or stop() method for a daemon.

However consider using a configuration file, to change the parameters of the daemon.
E.g.

  1. Update config file from Java
  2. Restart daemon from Java
  3. Read config file from daemon
1 Like

Hi jbm,
I have got a similar problem.
I write an urcap to deal with some hardware, a daemon is managing the hardware. The IP of the hardware could change, so I would like to pass the IP through a from urcap to a config file. When the deamon is stopped and started again it reads the IP from the config file. I put the config.properties file in path src/main/resources/ and can read the file via InputStream, but writing from Java is not possible.
Could you please give me a hint, where to put the config file.
Greetings Robert

I have the same problem. Robert, have you found a solution? Any hints would be helpful.