From 72b2923ec5a59ca35562e29b83b563eb7ad6fc63 Mon Sep 17 00:00:00 2001 From: torn Date: Wed, 1 Feb 2017 22:14:05 +0100 Subject: [PATCH] minio unit file and env file --- minio-wrapper.sh | 15 --------------- minio.env | 8 ++++++++ minio.service | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 39 insertions(+), 19 deletions(-) delete mode 100755 minio-wrapper.sh create mode 100644 minio.env diff --git a/minio-wrapper.sh b/minio-wrapper.sh deleted file mode 100755 index edebf82..0000000 --- a/minio-wrapper.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Simple wrapper for Minio -# -# (torn, 2017-01-26) - -bin="/home/cable/minio/minio" -conf="/home/cable/minio/conf/" -buckets="/home/cable/minio/buckets/" -addr="127.0.0.1:9000" - -export MINIO_BROWSER=off - -$bin server -C "$conf" --address "$addr" --quiet "$buckets" - diff --git a/minio.env b/minio.env new file mode 100644 index 0000000..32d4aba --- /dev/null +++ b/minio.env @@ -0,0 +1,8 @@ +# Local export path. +MINIO_VOLUMES="/home/cable/minio/buckets/" + +# Options +MINIO_OPTS="-C /home/cable/minio/conf/ --address 127.0.0.1:9000 --quiet" + +MINIO_BROWSER=off + diff --git a/minio.service b/minio.service index 6531145..bd22733 100644 --- a/minio.service +++ b/minio.service @@ -1,13 +1,40 @@ [Unit] -Description=Minio Cloud Storage -After=network.target +Description=Minio +Documentation=https://docs.minio.io +Wants=network-online.target +After=network-online.target [Service] -ExecStart=/home/cable/bin/minio-wrapper.sh -Restart=on-failure +WorkingDirectory=/home/cable/minio/ + +EnvironmentFile=-/home/cable/minio/minio.env +ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES\"" +ExecStart=/home/cable/minio/minio server $MINIO_OPTS $MINIO_VOLUMES + User=cable Group=cable +PermissionsStartOnly=true + +StandardOutput=journal +StandardError=inherit + +# Specifies the maximum file descriptor number that can be opened by this process +LimitNOFILE=65536 + +# Disable timeout logic and wait until process is stopped +TimeoutStopSec=0 + +# SIGTERM signal is used to stop Minio +KillSignal=SIGTERM + +SendSIGKILL=no + +SuccessExitStatus=0 + +Restart=on-failure [Install] WantedBy=multi-user.target +# Built for ${project.name}-${project.version} (${project.name}) +