cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

AppArmor blocks 'mknod'

AlexStepanov
Member

AppArmor blocks 'mknod'

Hello,

I'm trying to communicate with a basler camera through their pylon driver over ethernet.

When I login over ssh, I can successfully ping the camera. But when I start my application, it throws an exception (Failed to create embedded nodemap).

Looking through the logbook, I saw that apparmor denied the operation "mknod"

ctrlx_apparmor_denied.png

Installing the application (after compiling it for amd64) with --devmode on my computer, everything works fine. But without --devmode I receive the same exception.

I tried to add different plugs to my snapcraft.yml (block-devices, classic-support, etc.) but I still receive the same errors.

Are there any additional plugs or settings I can use, to enable the driver to setup a connection to the camera?

 

Best Regards
Alexander Stepanov

Tags (1)
2 REPLIES 2
CodeShepherd
Community Moderator

Re: AppArmor blocks 'mknod'

Did you install your snap on the ctrlX CORE also in devmode?

mknod seems to try to add folders and files to system to did you add the system-files plug?

For the plug and slot mechanism there are useful information in the docs of snapcraft.io.

 

AlexStepanov
Member

Re: AppArmor blocks 'mknod'

Thank you for the hint! I was also in contact with the support from Basler and I was missing the environment variable "GENICAM_CACHE_V3_1", which points to a directory, where the pylon library can temporarily store xml files containing camera informations. The default location is write protected, thus it was blocked by AppArmor.

Pointing the environemnt variable to $TMP solved my problem.

snapcraft.yaml

...
apps:
  baslercam:
    command: connectcamera
    plugs: [...]
    environment:      
      GENICAM_CACHE_V3_1: $TMP

...

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist