Actually, I am not sure that I can do this, because of the steps that I need to perform to make the camera be correctly accessed.
In particular, my snap app runs a Python script, that uses a Python library specific for the camera I use. Before installing the snap on the target system, I need to install the camera drivers in some folder (I usually choose /home/user/Documents/cams/) through a .run file; once the installation is completed, I get some files inside this folder, among which there is libstgentl.cti
Moreover, I need to use the command
source /home/user/Documents/cams/.stprofile and to append to my /home/user/.bashrc file the following lines:
export GENICAM_GENTL64_PATH STAPI_ROOT_PATH LIBRARY_PATH LD_LIBRARY_PATH
Since in my code I never specify the path of the libstgentl.cti file, I assume that the camera Python library autonomously looks for it according to the LIBRARY_PATH set in the .bashrc file.
In order to try to make my snap service find the library file, since as far as I understood it is run as root, I have used
sudo su and repeated the two steps of the
source command and of the appending of the previous lines to the /root/.bashrc file. In this way, if I run my snap command inside the root user I do not get the error anymore, but if I use my snap service I still get it, and the same in case I run the snap command in the local user with
I do not understand why the library file is not found, since I thought that defining LIBRARY_PATH in the .bashrc file would have been enough.
Do you have any other suggestions?