Error while loading shared libraries

Hi, @Vamsi3012,

Your Supervisor is failing to mount the SMACK (smackfs) file system.

Is your kernel built with SMACK enabled?

–Jen

@virajpadte, your problem is different. Your Supervisor is getting killed by the SIGALRM signal that gets fired in case the Supervisor takes longer than 30 seconds to run its start-up sequence.

This is reported in Legato on Generic Linux. I suspect you are having the same SMACK-related issues.

–Jen

@jchitty Thanks for been so responsive and committed to help. So from the discussion on smack issues, I presume we need to perform the following steps for getting this to work with newer kernels:

Add SCM_SECURITY to the standard library headers;
in unixSocket.c, in unixSocket_CreateSeqPacketUnnamed(), set the SO_PASSSEC socket option flag;
In unixSocket.c, in ExtractAncillaryData(), handle the SCM_SECURITY message (just throw it away);

Make the Supervisor add a couple of new SMACK rules:
“framework admin w”
“admin framework w”

Set the extended attribute “security.SMACK64EXEC” to “framework” on all command-line tools bundled with the framework.

Yes. The only other thing that might be needed is in framework/c/src/start/start.c, in the function MakeDir(), change the line

le_result_t result = le_dir_Make(dirPath, DEFAULT_PERMS);

to

le_result_t result = dir_MakeSmack(dirPath, DEFAULT_PERMS, "_");

This ensures that directories created by the start-up program get the correct SMACK label.

Hi @jchitty,

I do not know this. How do I check this?

Regards,
Vamsi

Hi, @Vamsi3012,

Do you have a file called /boot/config-4.4.50-v7+ (or something like that in /boot/ that matches the version of your kernel as output by uname -r)?

If so, when you run the following,

grep CONFIG_SECURITY_SMACK /boot/config-`uname -r`

You should see something like this

CONFIG_SECURITY_SMACK=y
# CONFIG_SECURITY_SMACK_BRINGUP is not set
CONFIG_SECURITY_SMACK_NETFILTER=y

The key point is that the following must appear in your kernel’s build configuration:

CONFIG_SECURITY_SMACK=y

If you see this instead, then SMACK is disabled in your kernel:

# CONFIG_SECURITY_SMACK is not set

Hi @jchitty,

Thanks for the continuous support.

I checked, and it turns out that there is no such file.

Could that be the reason? Or was there something wrong that I did while building the kernel?

Regards,
Vamsi

Maybe /proc/config.gz ?

Hi @CoRfr,

I do not have that either :neutral_face:

Regards,
Vamsi

@Vamsi3012 which platform are you trying to get legato working for?

If you built the kernel yourself, then you should have a .config file in your kernel build directory. Also, you should be able to run make menuconfig to check (and change) your kernel build configuration settings.

Cheers,

–Jen

Hiya,

And if you’re building your own kernel, then to get ‘/proc/config.gz’ you need to make sure that the following two options are enabled in menuconfig:

File systems  —>
   Pseudo filesystems  —>
   [*] /proc file system support

and

General setup  --->
   [*] Kernel .config support
   [*]   Enable access to .config through /proc/config.gz

or CONFIG_PROC_FS, CONFIG_IKCONFIG, and CONFIG_IKCONFIG_PROC if editing the .config file by hand

have a look here: https://www.xaprb.com/blog/2006/05/23/how-to-use-linuxs-proc-config-feature/ for a nice little write-up about this.

ciao, Dave

@jchitty,

I did a fresh build all over again and the problem is the same. Again, there was no .config file. So I had to generate it using the following commands:

modprobe configs

I had to execute that command because the config.gz was not there. After that I generated the .config file and I see that the settings that should have been merged from the legatocfg, are missing. I am not sure what I am doing wrong but I seem to be stuck here.

@davidc,

I shall try what you said and get back to you.

Thank you guys for your continuous support. Is there a possibility that there is already a kernel built for raspberry pi that I could perhaps just download and use?

Regards,
Vamsi

@jchitty and @davidc,

The problem was the way I updated the Kernel. Anyway, I now reinstalled everything neatly and correctly (finally!). But now I am faced with a different problem.

When I run /./mnt/legato/start I get this following log and the pi restarts after brief pause of 30 seconds.

syslogd: No process found
/legato/system/current/bin/startupScript: 42: /legato/systems/current/bin/startupScript: /sbin/syslogd: not found

And once it restarts, the pi doesn’t seem to recognise itself. Because it changes from pi@lite:~$ to I have no name!@lite:~$.

Is this a different Issue? Then maybe I could start a different thread.

Regards,
Vamsi

@virajpadte

I am working with Raspberry Pi 3.

Regards,
Vamsi

Hiya,

Just out of interest:

  1. do you actually have a /sbin/syslogd executable on the PI?
  2. what happens if you run the command as a superuser (i.e. sudo /./mnt/legato/start)?

ciao, Dave

Hi @davidc,

After the execution of the command, well there is no syslogd. But I will give it a check and see if this log is available before the execution of the command.

I had logged into into the pi as a root user.

Additionally, after the execution of the /./mnt/legato/start, every time I restart the pi I get this message when it the pi is starting:
[FAILED]: Failed to start Avahi mDNS/DNS-SD Stack.
See systemctl status avahi-deamon.service for details.

But this is file is in a format that is not readable. Found it in the /bin folder of the root partition.

Regards,
Vamsi

Hi @davidc

So I tried again and before the execution, there was no syslogd in the /sbin folder.

And yes, I now tried with sudo and I still have the same problem.

Regards,
Vamsi

BTW I made a patch to make the gdbserver inclusion optional: Only package gdbserver in devMode if available · legatoproject/legato-af@144b7f8 · GitHub

Hiya,

Hmm, if /sbsin/syslogd is not present before you start then there’s a problem for the legato service start.

I haven’t used a RPi for a while, and from a quick google I see that some versions of Raspbian OS don’t use syslogd as the logging daemon - instead they use rsyslog by default.

Off the top of my head I can see two things to try:

  1. see if simply hard symlinking the current logger program to /sbin/syslogd to ‘trick’ the legato startup into thinking things are OK.
  2. remove the existing system logger package and replace it with syslogd (but this could cause all sorts of issues!).

ciao, Dave