LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elevating lvuser permissions in Labview RT Linux

Solved!
Go to solution

Hi everyone, 

I am attempting a integrate an external library into a Labview RT Linux application.   I can compile and run an application using the library in C++ but the same application fails to run when called through Labview.  What I found is the compiled C++ application also fails to run from the command line when using the user lvuser.  The application fails with the following response:

ERROR - cannot change scheduling policy!
root privilege is required or realtime group has to be joined!

 

I attempted to add the lvuser to the administrators group using the command usermod -a -G administrators lvuser.  This had not effect.  I cannot call su admin from the application as the actual interface to the library is through the call library function.  Is there another way to elevated the user permissions of the lvuser? 

0 Kudos
Message 1 of 3
(3,869 Views)

I still need an answer.   Is anyone able to help? 

0 Kudos
Message 2 of 3
(2,160 Views)
Solution
Accepted by topic author bkopietz

I was able to solve this using setcap in the command shell.  I used the command:

setcap cap_net_bind_service,cap_net_admin,cap_ipc_lock,cap_sys_rawio,cap_sys_admin,cap_sys_boot,cap_sys_nice,
cap_sys_time+ep /usr/local/natinst/labview/lvrt  

 

Reboot the system for 

 

Inside of the Labview application you must call setuid(0) using call library function from the library libc.so.6.  Make sure to set run in any thread as this is per thread.  

 
Message 3 of 3
(2,107 Views)