jsinglet
jsinglet

Reputation: 1151

Ravenscar Task / Program Termination in Native Compilation

As I understand it, one restriction of the Ravenscar profile is that tasks should not terminate.

This certainly makes sense on bare metal, however when testing on a native system (as a executable program) it has the side effect that doing a Control-C to exit the main task leaves the program running in the background.

I plan to move my program to bare metal eventually and would like to be able to use the Ravenscar profile -- how can one allow the program to exit correctly when doing something like this? Abort statements are forbidden. If the Ravenscar profile was not applied, I could easily make this work by allowing tasks to terminate. Right now I am doing a killall -9, which works, but doesn't seem very elegant.

Upvotes: 1

Views: 74

Answers (1)

jsinglet
jsinglet

Reputation: 1151

As it turns out, the issue had to do with how I was executing the program. In my case I was doing it over a remote ssh command, eg:

ssh myhost "sudo su -c mycommand"

Adding a -t to allocate a tty fixes the issue, that is:

ssh -t myhost "sudo su -c mycommand"

Upvotes: 2

Related Questions