Restart lxc-reference after installation. lxcbuild
authorMarco Yuen <marcoy@cs.princeton.edu>
Wed, 4 Jan 2012 15:52:51 +0000 (10:52 -0500)
committerMarco Yuen <marcoy@cs.princeton.edu>
Wed, 4 Jan 2012 15:52:51 +0000 (10:52 -0500)
Add check to the initscript so that it won't do anything when it is
inside the build environment.

initscript/lxc-reference
lxc-reference.spec

index bdf6058..50cb01d 100644 (file)
@@ -18,6 +18,11 @@ case "$1" in
         ;;
 esac
 
+# Check if we are in the build environment
+mount | grep 'planetlab-vservers' > /dev/null
+RETVAL=$?
+[ $RETVAL -ne 0 ] && exit 0
+
 # Source function library
 . /etc/init.d/functions
 
index ee55822..1fccf02 100644 (file)
@@ -29,6 +29,9 @@ pushd /longbuildroot/SOURCES/lxc-reference-%{version}
 install -D -m 755 initscript/lxc-reference ${RPM_BUILD_ROOT}/%{_initrddir}/lxc-reference
 popd
 
+%post
+service lxc-reference restart
+
 %preun
 btrfs subvolume delete /vservers/.lvref/lxc-f14-x86_64
 btrfs subvolume delete /vservers/.lvref/lxc-squeeze-x86_64