added systemd instructions

This commit is contained in:
IUCCA
2020-06-10 17:16:13 +02:00
committed by Senan Kelly
parent dd258ebbeb
commit 56b43f33c9
3 changed files with 79 additions and 0 deletions

View File

@@ -70,6 +70,50 @@ services:
then start with `docker-compose up -d`
**Installation with systemd** (on ubuntu 18.04)
Prerequisites:
```bash
Add a repository with the latest Version of golang and install the prerequisites:
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update && sudo apt upgrade
sudo apt install build-essential git sqlite libtag1-dev ffmpeg libasound-dev golang
```
Download and compile gonic in the home directory
```bash
go get go.senan.xyz/gonic/cmd/gonic
```
Add a gonic user and create a directory for the server:
```bash
sudo mkdir -p /var/gonic/
sudo adduser --disabled-login --gecos "" gonic
sudo mv go/bin/gonic /var/gonic/
sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/config -O /var/gonic/config
sudo chmod -R 750 /var/gonic/
sudo chown -R gonic:gonic /var/gonic/
```
Add your music-path to the config file
```bash
sudo nano /var/gonic/config
```
Setup systemd service:
```bash
sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/gonic.service -O /etc/systemd/system/gonic.service
sudo systemctl daemon-reload
sudo systemctl enable --now gonic
```
## configuration options
|env var|command line arg|description|