From dabefc50470cd2e6fb9a83cac8992b5514926eb2 Mon Sep 17 00:00:00 2001 From: shim_ <> Date: Thu, 4 Oct 2018 16:31:05 +0200 Subject: [PATCH] improved systemd --- seafile.service | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/seafile.service b/seafile.service index d29f5ee..01ba47e 100644 --- a/seafile.service +++ b/seafile.service @@ -17,10 +17,12 @@ Environment=SEAF_UPGRADE_INTERVAL=10 #rkt --insecure-options=image run --dns 8.8.8.8 --volume volume-opt-seafile,kind=host,source=${ROOT_DIR} docker://repo.shimun.net/shimun/seafile --environment=SEAF_URL="https://seaf.example.com" --interactive ExecStartPre=/bin/mkdir -p ${ROOT_DIR} -ExecStart=/usr/bin/rkt --insecure-options=image run --dns 8.8.8.8 --inherit-env --volume volume-opt-seafile,kind=host,source=${ROOT_DIR} --port 80-tcp:8080 \ - docker://repo.shimun.net/shimun/seafile --environment=SEAF_UPGRADE_INTERVAL=${SEAF_UPGRADE_INTERVAL} - -ExecStopPost=/usr/bin/rkt gc +ExecStart=/usr/bin/rkt --insecure-options=image run --uuid-file-save=${ROOT_DIR}/container.uuid --dns 8.8.8.8 --inherit-env --volume volume-opt-seafile,kind=host,source=${ROOT_DIR} --port 80-tcp:8080 \ + docker://repo.shimun.net/shimun/seafile --environment=SEAF_UPGRADE_INTERVAL=${SEAF_UPGRADE_INTERVAL} +ExecStartPost=/bin/bash -c "echo 'rkt enter --app=seafile $(cat '${ROOT_DIR}'/container.uuid)' > ${ROOT_DIR}/enter.sh && chmod +x ${ROOT_DIR}/enter.sh" +ExecStopPre=/bin/bash -c "rkt enter --app=seafile $(cat ${ROOT_DIR}/container.uuid) 'seafile-server stop'" +ExecStopPost=/bin/bash -c "rkt rm $(cat ${ROOT_DIR}/container.uuid)" +ExecStopPost=/bin/rm ${ROOT_DIR}/container.uuid KillMode=mixed Restart=always RestartSec=30