The easiest way is to just use the systemd service framework, like is already in use by the demo image.
To add a new service, just create a file in /lib/systemd/system/myservice.service with content like:
And then make a symlink to this file in /etc/systemd/system/multi-user.target.wants/.
The service will start automatically on startup. You can also start and stop it manually, and query the status:
Using the BeagleBone >