Including Mnesia in a supervision tree?

Vance Shipley vances@REDACTED
Sat Feb 7 07:02:31 CET 2004


You should create a release.  Create a release resource file
like in this example file named myrelease.rel:

   {release, {"releasename", "0.1"}, {erts, "5.3.1"},
        [{kernel, "2.9.2"},
        {stdlib, "1.12.3"},
        {sasl, "1.10"},
        {mnesia, "4.1.6"},
        {eva, "2.0.4"},
        {myapp, "0.1"}]}.

Generate a boot script:

1> systools:make_script("myrelease").

This creates a boot script and a binary:


If you now start the emulator with:

$ erl -boot myrelease.boot

It causes the applications to be started in the order given in
the myrelease.rel file. 

To use this you should create a release package to be installed
on the target system:

2> systools:make_tar("myrelease").

Then follow the release handling instructions to build an 
embedded system which will start everything up as it should 
be automatically. (*)



On Fri, Feb 06, 2004 at 10:26:54PM -0500, Shawn Pearce wrote:

}  I've been beating my head against this for a little bit, and dug
}  around in the docs, searched the mailing list archives (as I'm sure
}  this has been covered):
}  How should I include mnesia in my application supervision tree?
}  I tried putting mnesia into the included_applications list in my
}  application spec record.  This caused my application to startup, but
}  mnesia was not started automatically by the application module.
}  So currently my supervisor process spawns mnesia_sup as a supervisor
}  child, along with my other child processes, with a one_for_all restart
}  policy.  This seems to work just fine, but I wonder if its really
}  the best strategy.
}  -- 
}  Shawn.

More information about the erlang-questions mailing list