Reader small image

You're reading from  Building a Home Security System with Raspberry Pi

Product typeBook
Published inDec 2015
Publisher
ISBN-139781782175278
Edition1st Edition
Right arrow
Author (1)
Matthew Poole
Matthew Poole
author image
Matthew Poole

Matthew Poole is a systems engineer based near Southampton on the south coast of England, with over 20 years of industry experience. After graduating in electronics and communications engineering, he went on to train as and become an air traffic engineer for Civil Aviation Authority, UK, working on microprocessor-based control and communications systems. Later, he became a software architect and mobile technology specialist, working for several consultancies and global organizations in both hands-on architecture and product-management roles . He is now a partner at Connecting Objects, a boutique systems consultancy focusing on the design of Bluetooth and other wireless-based IoT systems, taking ideas from concept to prototype. He is also the Director of Technology for Mobile Onboard, a leading UK-based transport technology company specializing in bus connectivity and mobile ticketing systems. He is also the author of Building a Home Security System with Raspberry Pi, Packt Publishing. You can find his blog at http://cubiksoundz.com and LinkedIn profile at https://www.linkedin.com/in/cubik, or you can reach him on Twitter at @cubiksoundz.
Read more about Matthew Poole

Right arrow

Automatically starting the system


Now, obviously, we don't want to have to manually start the alarm control script each time the Raspberry Pi boots up, for example, after a power failure—for a start, we may not even be there. Therefore, we need to set up our operating system so that it will automatically start up the alarm-control.sh script at boot time.

To do this, we need to edit the rc.local file using Nano:

$ sudo nano /etc/rc.local

Before the line containing exit 0, insert the following line:

sudo /etc/pi-alarm/alarm-control.sh &

Note

The & symbol at the end of the line is important because it will then make the script run in a different process, otherwise the rc.local script would never exit.

Your rc.local file should now look something like this:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building a Home Security System with Raspberry Pi
Published in: Dec 2015Publisher: ISBN-13: 9781782175278

Author (1)

author image
Matthew Poole

Matthew Poole is a systems engineer based near Southampton on the south coast of England, with over 20 years of industry experience. After graduating in electronics and communications engineering, he went on to train as and become an air traffic engineer for Civil Aviation Authority, UK, working on microprocessor-based control and communications systems. Later, he became a software architect and mobile technology specialist, working for several consultancies and global organizations in both hands-on architecture and product-management roles . He is now a partner at Connecting Objects, a boutique systems consultancy focusing on the design of Bluetooth and other wireless-based IoT systems, taking ideas from concept to prototype. He is also the Director of Technology for Mobile Onboard, a leading UK-based transport technology company specializing in bus connectivity and mobile ticketing systems. He is also the author of Building a Home Security System with Raspberry Pi, Packt Publishing. You can find his blog at http://cubiksoundz.com and LinkedIn profile at https://www.linkedin.com/in/cubik, or you can reach him on Twitter at @cubiksoundz.
Read more about Matthew Poole