Skip to content
Permalink
ec7af00e44
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
63 lines (41 sloc) 2.99 KB
# Managing Services
A lot of the software you will be installing, such as [MySQL](https://www.mysql.com) will need to run as background services. This tutorial will guide you through how to install and manage background services.
## 1 System D
https://www.linuxjournal.com/content/initializing-and-managing-services-linux-past-present-and-future
### 1.1 Installing Neo4J
In this section you will be shown how to install and run a Neo4J instance using SystemV.
## 2 Docker
You can use the [Docker Playground](https://labs.play-with-docker.com) to learn how to work with Docker.
## 3 Homebrew (MacOS Only)
Until now all the tools and techniques covered work on the Raspberry Pi or indeed any computer running a [Debian](https://www.debian.org) based [Linux](https://www.linux.org) distribution (such as [Ubuntu](https://ubuntu.com) or [Raspberian](https://www.raspbian.org)). If you are using a [Mac](https://www.apple.com/uk/mac) (and [MacOS](https://www.apple.com/uk/macos)) for your development work you should make use of the [Homebrew](https://brew.sh) package manager which provides commands to install, uninstall, update and run a wide range of software packages.
### 3.1 Installation
The installation instructions can be found on the main [website](https://brew.sh), in summary you need to run the following in the terminal app which uses the [Ruby](https://www.ruby-lang.org/en/) language:
```shell
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
### 3.2 Installing Packages
Once Homebrew has been installed you can use it in the terminal to install a wide range of software, for example to install MySQL:
1. Search for the software on the [Homebrew website](https://formulae.brew.sh/formula/mysql). This tells you the correct software name, in this case it is `mysql`.
2. Now we can install the software using `brew install mysql`.
### 3.3 Starting and Stopping Services
Many of the software packages run as background services and we need to be able to start, stop and restart these. The easiest way is to install the [Homebrew Services](https://github.com/Homebrew/homebrew-services) using `brew tap homebrew/services` command. The `tap` subcommand allows you to access other repositories that are not included in Homebrew's master repository.
Once the services are installed you can list the installed services and see if they are running using the following command:
```shell
$ brew services list
Name Status User Plist
mosquitto stopped
mysql stopped
neo4j stopped
```
Now we can start and stop the services:
```shell
$ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
$ brew services restart mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
$ brew services stop mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
```