From c7879120d9a406071395d4f135ce0a0ca7bcd58e Mon Sep 17 00:00:00 2001 From: loint Date: Thu, 15 Jan 2015 10:19:21 +0700 Subject: [PATCH 1/3] Fix folder /var/lock/subsys does not exists in centos 6 --- daemon_linux_systemv.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon_linux_systemv.go b/daemon_linux_systemv.go index 7795772..84cd662 100644 --- a/daemon_linux_systemv.go +++ b/daemon_linux_systemv.go @@ -234,6 +234,8 @@ lockfile="/var/lock/subsys/$proc" stdoutlog="/var/log/$proc.log" stderrlog="/var/log/$proc.err" +mkdir -p /var/lock/subsys + [ -e /etc/sysconfig/$proc ] && . /etc/sysconfig/$proc start() { From 4fdf36dac22bcc9278c9cf884f29e010b2eb66e8 Mon Sep 17 00:00:00 2001 From: Igor Dolzhikov Date: Thu, 15 Jan 2015 11:49:33 +0700 Subject: [PATCH 2/3] added creating a directory for lock file if it does not exist (thanks penlook) --- daemon_linux_systemv.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon_linux_systemv.go b/daemon_linux_systemv.go index 84cd662..8538c7d 100644 --- a/daemon_linux_systemv.go +++ b/daemon_linux_systemv.go @@ -234,7 +234,7 @@ lockfile="/var/lock/subsys/$proc" stdoutlog="/var/log/$proc.log" stderrlog="/var/log/$proc.err" -mkdir -p /var/lock/subsys +[[ -d $(dirname $lockfile) ]] || mkdir -p $(dirname $lockfile) [ -e /etc/sysconfig/$proc ] && . /etc/sysconfig/$proc From 0c75e49b2a2aadb223e28d4d35b5a8aae53d025b Mon Sep 17 00:00:00 2001 From: Igor Dolzhikov Date: Thu, 15 Jan 2015 11:51:22 +0700 Subject: [PATCH 3/3] Bumped version number to 0.2.5 --- daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon.go b/daemon.go index e3743a4..617bae6 100644 --- a/daemon.go +++ b/daemon.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. /* -Package daemon 0.2.4 for use with Go (golang) services. +Package daemon 0.2.5 for use with Go (golang) services. Package daemon provides primitives for daemonization of golang services. This package is not provide implementation of user daemon,