From dbc96b475ac93a490a3f5a58b91bc94f2642e4e3 Mon Sep 17 00:00:00 2001 From: bigeagle Date: Mon, 2 May 2016 19:04:21 +0800 Subject: [PATCH] added systemd service files --- README.md | 1 + systemd/tunasync-manager.service | 12 ++++++++++++ systemd/tunasync-worker.service | 14 ++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 systemd/tunasync-manager.service create mode 100644 systemd/tunasync-worker.service diff --git a/README.md b/README.md index 8fde1d2..2e42881 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ tunasync [![Build Status](https://travis-ci.org/tuna/tunasync.svg?branch=dev)](https://travis-ci.org/tuna/tunasync) [![Coverage Status](https://coveralls.io/repos/github/tuna/tunasync/badge.svg?branch=dev)](https://coveralls.io/github/tuna/tunasync?branch=dev) +![GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg) ## Design diff --git a/systemd/tunasync-manager.service b/systemd/tunasync-manager.service new file mode 100644 index 0000000..600e424 --- /dev/null +++ b/systemd/tunasync-manager.service @@ -0,0 +1,12 @@ +[Unit] +Description = TUNA mirrors sync manager +After=network.target +Requires=network.target + +[Service] +Type=simple +User=tunasync +ExecStart = /home/bin/tunasync manager -c /etc/tunasync/manager.conf --with-systemd + +[Install] +WantedBy=multi-user.target diff --git a/systemd/tunasync-worker.service b/systemd/tunasync-worker.service new file mode 100644 index 0000000..95b9f47 --- /dev/null +++ b/systemd/tunasync-worker.service @@ -0,0 +1,14 @@ +[Unit] +Description = TUNA mirrors sync worker +After=network.target + +[Service] +Type=simple +User=tunasync +PermissionsStartOnly=true +ExecStartPre=/usr/bin/cgcreate -t tunasync -a tunasync -g cpu:tunasync +ExecStart=/home/bin/tunasync worker -c /etc/tunasync/worker.conf --with-systemd +ExecStopPost=/usr/bin/cgdelete cpu:tunasync + +[Install] +WantedBy=multi-user.target