Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (36 sloc) 1.79 KB

Make a service on a Raspberry Pi 2 running Rasbian jessie

Jessie comes with systemd installed, which can be used to start services upon boot.

Run a NATS worker on your pi.


  • Raspberry Pi 2 with Rasbian jessie
  • On your network
  • You learn the ip.
  • For convenience of not having enter a password every time authorize your public key on the pi.
    • scp ~/.ssh/ pi@:/home/pi/.ssh/
    • ssh into the pi and append the contents of to ~/.ssh/authorized_keys


  • download pypy for Rasbian:
  • bunzip2 it and put it in /home/pi/ on the pi.
  • Extract the tar: tar -xvf pypy-4.0.1-linux-armhf-raspbian.tar
  • clone this repo to /home/pi/projects/ (hardcoded in the .service file)
  • copy this Makefile and nats.respond.1.service to /home/pi/ as that is where I wrote it and hardcoded some paths. TODO: Use environmental variables or maybe do this Chef
  • ssh into the pi
  • download to /home/pi/
    • curl -o
  • make install-pypy
  • make pypy-get-pip
  • make install-txnats

Optionally link pypy to your home bin directory, so you can run pypy without entering the whole path.

  • If it doesn't exist add a bin directory to your home directory. mkdir ~/bin
  • make link-pypy

Setup and start the services This will make four copies of the respond service.

  • make add-services
  • make start-services
  • make enable-services

See the status of the services:

  • make status-services

From your local machine you should now be able to run and the services on the pi will respond.

You can’t perform that action at this time.