<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I am a 2 month Erlang OTP newbie. I am trying to do my first release_handler:install_upgrade. It does not complain, but the upgrade functionality does not seem to take effect.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Is there a good instruction on using rebar and release_handler in Windows? I do not have any special requirements (not trying to do distributed Erlang) and I would be joyful to just have<o:p></o:p></p><p class=MsoNormal>an example project that would work.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>My information sources are the release_handler design principles and man pages, the github/basho/rebar, wiki.erlang-web.org/Rebar, Richard Jones' upgrade tutorial. Following some of these has not resulted in my upgrade working and others seem so oriented toward Unix or to their own sample application.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is how I am building my release and upgrade: I have two applications and their versions are expressed in three levels, 0.1.2. The name of the application module (qss_app.erl) is not the same as the application (queue_stats_server). Maybe a problem? reltool.config contains {rel, "QSS_SYS", "0.2", [...]}.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I open a git bash shell to build the release. For the first (the non-upgrade) release, I call rebar compile and rebar generate. I then copy the QSS_SYS folder from rel on the development machine and make it C:\QSS_SYS on the target machine (which had been empty of Erlang or QSS_SYS). I create a Windows service with the following command :<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>C:\QSS_SYS\releases\0.2\qss -config C:\QSS_SYS\releases\0.2\sys.config -s qss_main" -comment "Queue Statistics Server"<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>qss_main:start() calls application:start('QSS_SYS').<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The non-upgrade release works just fine.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Next I make an upgrade. I rename rel\QSS_SYS to rel\QSS_SYS_0.2. The only source code change is to write a new version number into the debug log. I change the app release from 0.1.2 to 0.1.3 in queue_stats_server.app.src. I change the release version from 0.2 to 0.3 in reltool.config.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I use a git bash shell to build the upgrade. I call the following:<o:p></o:p></p><p class=MsoNormal>rebar compile<o:p></o:p></p><p class=MsoNormal>rebar generate<o:p></o:p></p><p class=MsoNormal>rebar generate-appups previous_release=QSS_SYS_0.1<o:p></o:p></p><p class=MsoNormal>rebar generate-upgrade previous_release=QSS_SYS_0.1<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Everything responds with ok.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On the target machine I keep the QSS_SYS Windows service running. I copy the QSS_SYS_0.3.tar.gz to C:\QSS_SYS\Releases. I make sure the path variable points to erl under C:\QSS_SYS. I open an Erlang shell with: <o:p></o:p></p><p class=MsoNormal>werl -boot c:\QSS_SYS\releases\0.2\start_clean<o:p></o:p></p><p class=MsoNormal>I call the following:<o:p></o:p></p><p class=MsoNormal>cd("c:\\qss\\releases").<o:p></o:p></p><p class=MsoNormal>{ok, Pid} = release_handler:start_link().<o:p></o:p></p><p class=MsoNormal>release_handler:unpack_release("QSS_SYS_0.2").<o:p></o:p></p><p class=MsoNormal>release_handler:install_release("0.2").<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think the symptoms have already started because I suspect that I should not have needed to call release_handler:start_link/0. I think there should already be one running with the QSS_SYS windows service. The fact, that I do not know the OTP-appropriate place or way to have it started, makes me think that I have not read the right documentation.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I try to run release_handler:make_permanent("0.3"), but it returns {error,{service_update_failed,service_name_missmatch}}. I think that is because<o:p></o:p></p><p class=MsoNormal>nonode@nohost = node().<o:p></o:p></p><p class=MsoNormal>I don't know much about nodes, but I think they are associated with distributed Erlang, which I am not using.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It seems too much to expect that someone can see all of my mistakes from this, but I do hope that someone can point me to a reproducible example of going from nothing through a first release, through an upgrade release for an embedded Erlang system as a Windows service.<o:p></o:p></p></div></body></html>