Cannot Modify or Delete Files on an NI Linux Real-Time Target With Web Interface

Updated Jul 5, 2023

Reported In

Software

  • LabVIEW Real-Time Module
  • LabVIEW

Operating System

  • NI Linux Real-Time

Issue Details

  • I have an application that produces and stores multiple files on a cRIO. When using the cRIO Web Interface, I am unable to delete/modify/rename files created by the application. How do I fix this?
  • My Application is producing 0 kb files and I believe it is because my target is out of storage. I want to remove old files from my target using the web interface or Windows file explorer and it looks like the files are removed successfully when I refresh the files reappear. How can I delete these files?

Solution

To to able to modify files on the cRIO through the web interface, we'll have to change permission settings in the folders where the files are stored.
  1. Connect to the cRIO's shell by following the steps on Accessing the Shell on NI Linux Real-Time Devices.
  2. Issue a chmod g+rwx [location] command, where [location] is the directory where the files are stored.

Additional Information

Since Linux is a multi-user operating system, multiple users can interact with the system at the same time. It is common practice in Linux to start different processes with their own reduced user rights. This means that each process (or group of similarly acting processes) has its own user.

LabVIEW processes are run as the user lvuser while Web Interface processes are run as the user webuser. Since webuser by default does not have permission to access files by lvuser, you are unable to access those files.

By issuing an appropriate chmod command, we give all users in the same group as the owner Read-Write-Execute permissions for that location. Both lvuser and webuser are grouped together in the group ni, so webuser will now have access to the files in that location.

If you need to make more specific access control rules, review the Access Control section in the NI Linux Real-Time Security User Guide  for reference.