Download Erlang/OTP System Documentation
Transcript
2.3 Creating and Upgrading a Target System
Here also the path to the pea-1.0 ebin directory is provided.
Step 3. Create the target system:
1> target_system:create("mysystem").
The function target_system:create/1 performs the following:
•
•
•
Reads the file mysystem.rel and creates a new file plain.rel that is identical to the former, except that
it only lists the Kernel and STDLIB applications.
From the files mysystem.rel and plain.rel creates the files mysystem.script, mysystem.boot,
plain.script, and plain.boot through a call to systools:make_script/2.
Creates the file mysystem.tar.gz by a call to systools:make_tar/2. That file has the following
contents:
erts-5.10.4/bin/
releases/FIRST/start.boot
releases/FIRST/mysystem.rel
releases/mysystem.rel
lib/kernel-2.16.4/
lib/stdlib-1.19.4/
lib/sasl-2.3.4/
lib/pea-1.0/
The file releases/FIRST/start.boot is a copy of our mysystem.boot
•
•
•
•
•
•
•
•
The release resource file mysystem.rel is duplicated in the tar file. Originally, this file was only stored in
the releases directory to make it possible for the release_handler to extract this file separately. After
unpacking the tar file, release_handler would automatically copy the file to releases/FIRST. However,
sometimes the tar file is unpacked without involving the release_handler (for example, when unpacking
the first target system). The file is therefore now instead duplicated in the tar file so no manual copying is needed.
Creates the temporary directory tmp and extracts the tar file mysystem.tar.gz into that directory.
Deletes the files erl and start from tmp/erts-5.10.4/bin. These files are created again from source
when installing the release.
Creates the directory tmp/bin.
Copies the previously created file plain.boot to tmp/bin/start.boot.
Copies the files epmd, run_erl, and to_erl from the directory tmp/erts-5.10.4/bin to the directory
tmp/bin.
Creates the directory tmp/log, which is used if the system is started as embedded with the bin/start
script.
Creates the file tmp/releases/start_erl.data with the contents "5.10.4 FIRST". This file is to be
passed as data file to the start_erl script.
Recreates the file mysystem.tar.gz from the directories in the directory tmp and removes tmp.
2.3.2 Installing a Target System
Step 4. Install the created target system in a suitable directory.
2> target_system:install("mysystem", "/usr/local/erl-target").
48 | Ericsson AB. All Rights Reserved.: Erlang/OTP System Documentation