/usr/libexec/linuxcnc/rtapi_app_posix not setuid

55 views
Skip to first unread message

Sardar Vayghannezgad

unread,
Apr 15, 2019, 6:38:53 AM4/15/19
to Machinekit
Hi
I want to run the PocketNC config on my BBB, but it outputs (lines looking important to my eyes are in colors or underlined):

machinekit@beaglebone:~$ machinekit
MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.PocketNC'
Machine configuration file is 'PocketNC.ini'
Starting Machinekit...
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=1 --usrmsglevel=1 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_posix --instance=0
/usr/bin/realtime: line 237: /usr/libexec/linuxcnc/rtapi_app_posix: No such file or directory
rtapi_app startup failed; aborting
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:22 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
io started
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:27 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
halcmd loadusr io started
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:33 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:38 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
Shutting down and cleaning up Machinekit...
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:46 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
E: 19-04-15 10:33:51 dangling 'DEALER' socket created at hal/utils/halcmd_rtapiapp.cc:284
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=cbc792ea-1cc7-4bda-a949-9dd1552ce3bc): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
ERROR:  msgd:0 failed to exit on its own; sending SIGTERM
Cleanup done
Machinekit terminated with an error.  For simple cases more information
can be found in the following files:
    /home/machinekit/linuxcnc_debug.txt
    /home/machinekit/linuxcnc_print.txt

For other cases get more meaningfull information by restarting after
    export DEBUG=5

and look at the output of:
    /var/log/linuxcnc.log
    dmesg

When looking for errors, specifically look for libraries that fail to load
by looking for lines with 'insmod failed' as per example below.

insmod failed, returned -1:
do_load_cmd: dlopen: nonexistant-component.so: cannot open shared object file:
No such file or directory

For getting help, please have a look here: www.machinekit.io/docs/getting-help/


My system info. is:
Linux beaglebone 4.14.108-ti-r104 #1 SMP PREEMPT Tue Apr 9 18:16:29 UTC 2019 armv7l GNU/Linux


As for the warning in red In the error above, I browsed the directory, and found it looks like:
machinekit@beaglebone:/usr/libexec/linuxcnc$ ls
flavor  inivar  pci_read  pci_write  rtapi_app_rt-preempt  rtapi_msgd
As obvious, rtapi_app_posix is missing.

As for the line in yellow, line 237 of my realtime file goes:
local cmd=(${rtapi_app} --instance=$MK_INSTANCE $RTAPI_APP_OPTS)
    if [ $DEBUG -gt 0 ] ; then
        echo "rtapi_app command:  ${cmd[@]}" >&2
        "${cmd[@]}" || (
            e=$?; echo "rtapi_app startup failed; aborting" >&2; exit $e)
    else
        "${cmd[@]}" 2>&1 || (
            e=$?; echo "rtapi_app startup failed; aborting" >&2; exit $e)
    fi


As for the closing errors, I have no idea what to do.
Opening the file /var/log/linuxcnc.log, pointed out in the error,

I have already done these to fix previous/this problem:

  • Applied these instructions to shift from tree overlays to U-boots.
  • To overcome a "permission denied" error I used to get, a friend of mine applied a chmod 755 command (or something) and the error doesn't appear anymore apparently.

If you believe any of the steps I have already taken should have fixed my problem, let me know please; as I might have missed something somewhere, as someone new to Linux, M.K and BBB.

It looks like I have ended up in a dead end on my task. Please help me out with this, I feel like I have already gone the extent to which I could go as a beginner.


schoo...@gmail.com

unread,
Apr 15, 2019, 7:52:56 AM4/15/19
to machi...@googlegroups.com
This has come up previously on this list.

If your kernel is not recognised as rt-preempt, flavour will default to POSIX.

Then when machinekit tries to load the posix version of rtapi_app, it fails because that does not exist.
The setuid warning is a red herring.

Your kernel 4.14.108-ti-r104 #1 SMP PREEMPT
may be the same one someone else tried to use with the same result.

I would expect to see ' SMP RT PREEMPT' in the uname output if it was a proper rt-preempt kernel.

Search the posts and you will find which kernel they went with in the end.
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Sardar Vayghannezgad

unread,
Apr 15, 2019, 10:53:43 AM4/15/19
to schoo...@gmail.com, Machinekit
I am not by my  BBB right now, but will take a look at the forum results.

Mailtrack Sender notified by
Mailtrack 04/15/19, 5:52:19 PM

You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/82h11IE_VX0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machinekit+...@googlegroups.com.

justin White

unread,
Apr 15, 2019, 5:45:19 PM4/15/19
to Machinekit
I don't think that's an RT patched kernel. Looks like it was just configured with preempt options?

unless there's another source for RT-preempt patches, there is no patch set for 4.14.108. 4.14.109 has a patch. Take that with a grain of salt since I've never dealt with a BBB, but with ARM boards it's always a pain to find an RT-P patchable kernel since the board manufacturer usually selects a random kernel and applies their own patches and it never seems to have been a candidate for an official RT-P patch.  The BBB seems to be on mainline with additional patches so it should be a bit easier.

Came across this with a link to a git repo with BBB patches. Appears there are plenty newer RT(preempt?) kernel patches.
To unsubscribe from this group and stop receiving emails from it, send an email to machi...@googlegroups.com.

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/82h11IE_VX0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machi...@googlegroups.com.

schoo...@gmail.com

unread,
Apr 16, 2019, 2:46:51 AM4/16/19
to machi...@googlegroups.com

Indeed and as I said previously.

It looks like texas instrument based kernels have -rt in the kernel name if the kernel is properly realtime,

but that is only as good as the person who names it and cannot be totally relied upon.

To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.

Sardar Vayghannezgad

unread,
Apr 16, 2019, 5:08:57 AM4/16/19
to Machinekit
Thanks, I will see if I will finally manage to make something out of that link.

Two points I wanted to mention:

1. in my time installing Machinekit repos from here, I was stuck over installing this RT-Kernel. So I posted a question on the forum to fix things. I might be off the point here, but I was told to go 
cd /opt/scripts/tools/
git pull
sudo ./update_kernel.sh --ti-rt-channel --lts-4_4
Does this account for my present problem?


2. A couple hours ago and with help of here, I dag into some directory to find a file named Makefile.inc. Its opening lines look like (see yellow lines for supposedly important parts)
#                                                          -*-makefile-gmake-*-
# Makefile.inc.  Generated from Makefile.inc.in by configure.
# on Thu Mar 14 10:48:16 UTC 2019
#

# Define libexec dir first, since it contains tools needed to compute
# following definitions
EMC2_LIBEXEC_DIR=${exec_prefix}/libexec/linuxcnc

# Threads systems
#################

# List of thread flavors to build modules
BUILD_THREAD_FLAVORS= posix rt-preempt

# If $(threads) is not set already, try running 'flavor'; if the
# result is empty or not in $(BUILD_THREAD_FLAVORS), pick the first
# item from $(BUILD_THREAD_FLAVORS).
threads ?= $(shell echo $(BUILD_THREAD_FLAVORS) | \
        awk -v f="`${EMC2_LIBEXEC_DIR}/flavor 2>/dev/null`" '\
        { \
            found=$$1; \
            split($$0,flavs); \
            for (val in flavs) \
                if (flavs[val] == f) found=f; \
            print found; \
        }')

# Uppercase version of flavor name for use in variables
THREADS = $(shell echo $(threads) | tr a-z- A-Z_)

HAVE_POSIX_THREADS=yes
HAVE_RT_PREEMPT_THREADS=yes
HAVE_XENOMAI_THREADS=no
HAVE_KERNEL_THREADS=no

POSIX_THREADS_FLAVOR_ID=0
RT_PREEMPT_THREADS_FLAVOR_ID=1
XENOMAI_THREADS_FLAVOR_ID=2
THREAD_FLAVOR_ID=$($(THREADS)_THREADS_FLAVOR_ID)

POSIX_THREADS_BUILD_SYS = user-dso
RT_PREEMPT_THREADS_BUILD_SYS = user-dso
XENOMAI_THREADS_BUILD_SYS = user-dso
BUILD_SYS = $($(THREADS)_THREADS_BUILD_SYS)

.
.
.

CC = arm-linux-gnueabihf-gcc
CC_FOR_BUILD = /usr/lib/ccache/gcc
OBJCOPY = arm-linux-gnueabihf-objcopy
LD = arm-linux-gnueabihf-ld
CROSS_COMPILING = yes
PKG_CONFIG = /usr/bin/arm-linux-gnueabihf-pkg-config
MANDB = /usr/bin/mandb
HIDRAW_H_USABLE = yes

POSIX_THREADS_SOURCE = rt-preempt
RT_PREEMPT_THREADS_SOURCE = rt-preempt
XENOMAI_THREADS_SOURCE = xenomai
THREADS_SOURCE = $($(THREADS)_THREADS_SOURCE)

BUILD_DRIVERS = yes
USE_PORTABLE_PARPORT_IO = no
TARGET_PLATFORM_PC =
TARGET_PLATFORM_SOCFPGA = yes
TARGET_PLATFORM_BEAGLEBONE = yes
TARGET_PLATFORM_CHIP = yes
TARGET_PLATFORM_RASPBERRY = yes
TARGET_PLATFORM_ZEDBOARD = yes
TARGET_PLATFORM_H3 = yes

HARDY_AMD64_WORKAROUND=@HARDY_AMD64_WORKAROUND@
PRECISE_MULTILIB_BUG=

ifeq ($(BUILD_SYS),user-dso)
USERMODE_PCI=yes
else
USERMODE_PCI=no
endif

I manipulated the file for rt-Preempt, with not much success though. I wonder if this file has anything to do with my case, and if yes how I can go about manipulating it to fix things.

schoo...@gmail.com

unread,
Apr 16, 2019, 10:29:42 AM4/16/19
to machi...@googlegroups.com

On 16/04/19 09:08, Sardar Vayghannezgad wrote:
1. in my time installing Machinekit repos from here, I was stuck over installing this RT-Kernel. So I posted a question on the forum to fix things. I might be off the point here, but I was told to go 
cd /opt/scripts/tools/
git pull
sudo ./update_kernel.sh --ti-rt-channel --lts-4_4
Does this account for my present problem?

Your present problem is that the kernel you are trying to use is NOT realtime

The kernel name string does NOT say '-rt' despite the update script specifying '-ti-rt'

Also don't understand how you specified a 4.4 kernel to the update script and get a 4.14 kernel (4.14.108-ti-r104 #1 SMP PREEMPT)
( various revisions of which are known to be flaky and have caused all sorts of problems in the past )



2. A couple hours ago and with help of here, I dag into some directory to find a file named Makefile.inc. Its opening lines look like (see yellow lines for supposedly important parts)

The 'some' directory you dug into is under /usr/share/linuxcnc.

This reference to flavours, all relates to the same issue but not in any way that will help you.  So don't waste time changing things to try and beat the system.
If somehow you convinced machinekit that your kernel was realtime, it still would not work, because it isn't realtime.

The bottom line is that you need a kernel that is realtime preempt

RCN's kernels are all here http://repos.rcn-ee.com/debian/pool/main/l/linux-upstream/

You will see there are lots which are <kernel-num>-ti-r<revision-num> like yours
and then there are <kernel-num>-ti-rt-r<revision-num>  which are the realtime kernels.

It will be one of those you want and I would suggest a 4.9 kernel which is stable and well proved.


Sardar Vayghannezgad

unread,
Apr 16, 2019, 3:09:05 PM4/16/19
to Machinekit
Great information for me. I have been speculating different possibilities since morning today, and finally realized that I have a good number of kernels already installed on my BBB!!! Touch wood, there are 4 actually!! 
ii  linux-image-4.14.108-ti-r104              1stretch                                          armhf        Linux kernel, version 4.14.108-ti-r104
ii  linux-image-4.14.108-ti-rt-r104           1stretch                                          armhf        Linux kernel, version 4.14.108-ti-rt-r104
ii  linux-image-4.14.94-ti-r94                1stretch                                          armhf        Linux kernel, version 4.14.94-ti-r94
ii  linux-image-4.4.155-ti-rt-r153            1stretch                                          armhf        Linux kernel, version 4.4.155-ti-rt-r153

So, does this account for the system not finding the rt-preempt kernel, and instead tune to posix, as Schooner previously described in their first response? Not exactly sure from where on my installation journey(!), but I do recall that I was supposed to work with linux-image-4.4.155-ti-rt-r153.

Questions
  1. As I want to avoid the lengthy path of installing everything from scratch, I want to start removing all the other three kernels and maintain the linux-image-4.4.155-ti-rt-r153. Reasonable, you think? Or can you experts tell right off the bat that this kernel will not work out either?
  2. I have been following this page to install my M.K on the BBB. Can anyone help me with the command offered in that link under the title 'Install the RT Kernel', in case I want to install another kernel (e.g. a 4.9 one, as Schooner suggested). what should I change that command into?
Thanks everyone for your time.
Reply all
Reply to author
Forward
0 new messages