add wrapper script to support logging to a file
authorElan Ruusamäe <glen@delfi.ee>
Mon, 15 Feb 2016 22:06:38 +0000 (00:06 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 15 Feb 2016 22:06:38 +0000 (00:06 +0200)
docker.init
docker.sh [new file with mode: 0755]
docker.spec

index 7ba800b..3a77c1f 100755 (executable)
@@ -28,6 +28,8 @@ else
        exit 0
 fi
 
+DOCKER_LOGFILE=/var/log/docker.log
+
 # Get service config - may override defaults
 [ -f /etc/sysconfig/docker ] && . /etc/sysconfig/docker
 
@@ -44,8 +46,11 @@ start() {
        # https://github.com/docker/docker/issues/2758
 
        msg_starting "Docker"
-       daemon --fork --pidfile $pidfile --waitfortime 60 \
-               /usr/bin/docker daemon $OPTIONS
+
+       export DOCKER_LOGFILE
+       daemon \
+               --fork --pidfile $pidfile --waitfortime 60 \
+               /usr/lib/docker daemon $OPTIONS
 
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/docker
diff --git a/docker.sh b/docker.sh
new file mode 100755 (executable)
index 0000000..d48bd0d
--- /dev/null
+++ b/docker.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 1>>$DOCKER_LOGFILE
+exec 2>&1
+exec /usr/bin/docker "$@"
index f25e092..a3dd1c8 100644 (file)
@@ -9,11 +9,12 @@
 Summary:       Docker: the open-source application container engine
 Name:          docker
 Version:       1.10.1
-Release:       0.1
+Release:       0.2
 License:       Apache v2.0
 Group:         Applications/System
 Source0:       https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 19f027d937069b104dfb0a4a01f2e30f
+Source1:       %{name}.sh
 Source5:       %{name}.service
 Source6:       %{name}.init
 Source7:       %{name}.sysconfig
@@ -48,6 +49,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                bash_compdir    %{_datadir}/bash-completion/completions
 %define                _vimdatadir             %{_datadir}/vim
+%define                _libexecdir             %{_prefix}/lib
 
 # binary stripped or something
 %define                _enable_debug_packages 0
@@ -116,12 +118,14 @@ DEBUG=1 hack/make.sh dynbinary
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
+       $RPM_BUILD_ROOT%{_libexecdir} \
        $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,init,tmp,trust,vfs,volumes}
 
 install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker
 install -p bundles/%{version}/dynbinary/dockerinit-%{version} $RPM_BUILD_ROOT%{_bindir}/dockerinit
 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/docker
 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker
 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
@@ -168,6 +172,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(754,root,root) /etc/rc.d/init.d/docker
 %attr(755,root,root) %{_bindir}/docker
 %attr(755,root,root) %{_bindir}/dockerinit
+%attr(755,root,root) %{_libexecdir}/docker
 %{systemdunitdir}/docker.service
 /lib/udev/rules.d/80-docker.rules
 #%{_mandir}/man1/lxc-docker.1*
This page took 0.101947 seconds and 4 git commands to generate.