Killing a process
It is possible to kill an application running on the Raspberry Pi by passing process pid to the kill() function. In the previous chapter, we discussed the light_scheduler example that runs as a background process on the Raspberry Pi. To demonstrate killing a process, we are going to attempt killing that process. We need to determine the process pid of the light_scheduler process (you may pick an application that was started by you as a user and not do not touch root processes). The process pid could be retrieved from the command-line terminal using the following command:
ps aux
It spits out the processes currently running on the Raspberry Pi (shown in the following figure). The process pid for the light_scheduler application ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access