but that just runs bjar. I have also tried a single command with the two jars in qoutes separated by a semicolon, but that gave a file not found error.
In most cases when I need to do things like this I usually write a small script that starts both programs, include it inside the snap and points my command to that one. But considering that your example is simple with exactly the same environment you could probably do something like this:
The command that is executed is now sh (shell) and it’s runs the two additional commands. You can inspect the generated scripts in /snap/my-snap-name/current/command-app-name.wrapper
Thanks. That indeed runs the first one but since they are both servers, once the server is running, execution waits at that point and never runs the second one.
Are the applications services intended to be executed in the background? If that’s the case the daemon keyword may be useful? I’m curious, what problem is you trying to solve? It the command intended to be executed/started interactively by a user, or?
An important note is that daemons is executed as root (but they are still confined), and not as the current user. So paths like $SNAP_DATA will point to /var/snap/... and not $HOME/snap.