Secured Open Source Embedded Software

Background:

The functions sd_listen_fds and sd_listen_fds_with_names check the values of $LISTEN_FDS/$LISTEN_PID and fail when they are not correctly set (man sd_listen_fds).

So replacing

ExecStart=/myprog...

with

ExecStart=/usr/bin/strace /myprog...

doesn't work because the value of $LISTEN_PID points the process strace.

Solution:

So to trace myprog you have to write:

ExecStart=/bin/sh -c '/usr/bin/strace -p $$$$ & exec /myprog...'

The dollar sign has to appear 4 times because of systemd escaping/expansion rules (man systemd.service)

And dont forget the exec

 

Archived Publications

About us

Our redpesk® product: a software factory in a white box enabling you to speed up and control your embedded developments from the initial design cycle to your product end of life.

Contact information

IoT.bzh

Halles St Louis,
    rue Docteur Bodelio
56100 Lorient
02 57 62 02 47