From 72b192c4cfb87aa42d95d24651c4c075cb30bc99 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 12 Oct 2016 08:21:32 -0400 Subject: [PATCH] Add ocid.service Signed-off-by: Dan Walsh --- .gitignore | 1 + Makefile | 4 ++++ ocid.service | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 ocid.service diff --git a/.gitignore b/.gitignore index 7e048ddf..23993a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ pause/pause.o /docs/ocid.8 /docs/ocid.conf.5 vendor/src/github.com/kubernetes-incubator/cri-o +ocid.conf diff --git a/Makefile b/Makefile index 6d8e5fc0..3f8ab65e 100644 --- a/Makefile +++ b/Makefile @@ -92,8 +92,12 @@ install: install -m 644 $(wildcard docs/*.8.md) $(PREFIX)/share/man/man8 install -d $(PREFIX)/share/man/man5 install -m 644 $(wildcard docs/*.5.md) $(PREFIX)/share/man/man5 + install -D -m 644 ocid.service $(PREFIX)/lib/systemd/system uninstall: + systemctl stop ocid.service + systemctl disable ocid.service + rm -f $(PREFIX)/lib/systemd/system/ocid.service rm -f ${INSTALLDIR}/{ocid,ocic} rm -f $(PREFIX)/libexec/ocid/{conmon,pause} for i in $(wildcard docs/*.8.md); do \ diff --git a/ocid.service b/ocid.service new file mode 100644 index 00000000..62f78f28 --- /dev/null +++ b/ocid.service @@ -0,0 +1,23 @@ +[Unit] +Description=Open Container Initiative Daemon +Documentation=https://github.com/kubernetes-incubator/cri-o +After=network.target + +[Service] +Type=notify +EnvironmentFile=-/etc/sysconfig/ocid-storage +EnvironmentFile=-/etc/sysconfig/ocid-network +Environment=GOTRACEBACK=crash +ExecStart=/usr/bin/ocid \ + $OCID_STORAGE_OPTIONS \ + $OCID_NETWORK_OPTIONS \ +ExecReload=/bin/kill -s HUP $MAINPID +TasksMax=8192 +LimitNOFILE=1048576 +LimitNPROC=1048576 +LimitCORE=infinity +TimeoutStartSec=0 +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target