[erlang-questions] Error while installing new release

Paul Guyot <>
Thu Apr 2 12:18:54 CEST 2009


> Date: Thu, 2 Apr 2009 01:14:43 -0700 (PDT)
> From: Yogish Baliga <>
> Subject: [erlang-questions] Error while installing new release
> To: Erlang Questions <>
> Message-ID: <>
>
> Hello all,
>
>  I have done all the steps required to release an application.  
> release_handler:unpack_release("2") worked fine. It create lib/ 
> erlang/releases/2 directory and files within it. 3 files are create  
> in the directory.
> start.boot, relup and myapp-2.rel
>
> While installing the release (release_handler:install_release("2")),  
> I am getting the error
>
> {error,{enoent,"/usr/local/lib/erlang/releases/R12B/relup"}}
>
> Any clue on how to solve this?

Each release must be defined as a successor of the previously  
installed release. However, this does not make much sense for the  
first release, which seems to be what release "2" is on your system.

 From what I understand, you need to directly unpack the tarball  
somewhere (without release_handler:unpack_release/1), which will be  
your new OTP_ROOT. You need to call release_handler:create_RELEASES/4  
using the old OTP_ROOT in order to bootstrap your system and create  
the RELEASES file in the new OTP_ROOT. You will also need to create  
the scripts in OTP_ROOT/bin manually, by copying those from OTP_ROOT/ 
erts-*/bin/ and fixing paths.

Here is our Makefile's target to do this (on a MacOS X system where  
OTP is installed in /opt/local/bin/erlang):

> TARBALL=target/${RELEASE_NAME}.tar.gz
>
> # Target to create the otp root (non-upgrade case).
> ${OTP_ROOT}: ${TARBALL}
> 	# Create the directory.
> 	mkdir ${OTP_ROOT}
> 	# Untar the tarball.
> 	cd ${OTP_ROOT} && tar xzf ../${TARBALL} && cd ..
> 	# Create the scripts
> 	mkdir ${OTP_ROOT}/bin
> 	@for file in ${OTP_ROOT}/erts-*/bin/*.src src/main/scripts/*.src ;  
> do \
> 		basename=`basename $$file`; \
> 		destfile=`echo $$basename | sed -e "s,.src,,g"`; \
> 		sed -e "s,%FINAL_ROOTDIR%,${DEST_DIR},g" < $$file > ${OTP_ROOT}/ 
> bin/$$destfile; \
> 		chmod ugo+rx ${OTP_ROOT}/bin/$$destfile; \
> 	done
> 	# Create the RELEASES file.
> 	erl -eval 'release_handler:create_RELEASES("${DEST_DIR}", "$ 
> {OTP_ROOT}/releases/${RELEASE_NAME}.rel"), erlang:halt().' -noshell
> 	# Copy start.boot to be able to use erl directly.
> 	cp /opt/local/lib/erlang/bin/start.boot "${OTP_ROOT}/bin/"

Each subsequent release is installed with the  
release_handler:unpack_release/1, release_handler:install_release/1,  
release_handler:make_permanent/1 dance.

Paul




More information about the erlang-questions mailing list