Skip to Content
Learn Robotics Programming
book

Learn Robotics Programming

by Danny Staple
November 2018
Beginner
472 pages
13h 5m
English
Packt Publishing
Content preview from Learn Robotics Programming

Using systemd to automatically start the robot

We encountered systemd in the voice control chapter as a way to automatically start the PulseAudio system. Here, you can use systemd to start the menu when the Raspberry Pi is ready. See additional reading for more information about Raspberry Pi systemd.

This is done by creating a unit file, which we will copy into place on our Pi.

Call this file menu_server.service. First we give it a description, and tell systemd to start our service after we have networking on our Raspberry Pi:

[Unit]Description=Robot Menu Web ServiceAfter=network.target...

Now, we tell systemd we want this to start as the Pi is ready for users to log in:

...[Install]WantedBy=multi-user.target...

The next section configures ...

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.
Start your free trial

You might also like

Learn Robotics Programming - Second Edition

Learn Robotics Programming - Second Edition

Danny Staple

Publisher Resources

ISBN: 9781789340747Supplemental Content