fix(core): broken single application mode
Description
When specifying "UNIQUE ON" as a parameter of the sight_add_target()
in the CMakeLists.txt
, the resulting application should refuse to be launched if another instance is already launched. This doesn't work anymore, for some time. We need to fix that, especially for application using unique resources (like a US probe)
Steps to reproduce
Launch several times an application constructed with the CMake macro sight_add_target(my_wonderful_app TYPE APP UNIQUE ON)
. You shouldn't be able to do so.
Functional specifications
In sightrun
, check if an application pid with the same profile already exist in the user "cache" directory. If yes, check if it is still running, and if yes, halt here. Otherwise, start as usual.
Technical specifications
We will use sight::core::os::temp_file
to ensure automatic deletion once outside main()
. sight::core::tools::os
and sight::core::tools::system
will give us access to pid and if the process is still running or not.
Test plan
- manual