shouldn't the onServerInstall script in commandbox...
# box-products
j
shouldn't the onServerInstall script in commandbox run when a new version of the server is downloaded if we're not specifying engine version? This is the second time I believe the server updated but the script didn't run... I use it to call cfpm and install some modules, but none of those modules got installed.
r
I use
onServerInstall
as well to install cfpm modules and I have not seen an issue. There is also the
onServerInitialInstall
hook that fires the first time a CF engine is installed.
Admittedly, I haven't updated the CFEngine
j
I think the issue may be that a new server was created with the same name since I specify name in the server.json file... the server that started also didn't have the cfconfig changes. I did
server forget
and it deleted the original one (the prior version) and then started it again, and the cfconfig changes are now present
so, when updating like this, is CommandBox leaving an older server with the same name on the system intentionally?
i assume not, since i've seen in the past where it creates different engine folders under the server root
b
@John Liljegren
onServerInstall
actually runs EVERY time the server starts
and indicates that, at that point in time, the cf engine home is guaranteed to be present on disk.
The
onServerIntialInstall
only runs the first time a cf engine home is created
so, when updating like this, is CommandBox leaving an older server with the same name on the system intentionally?
sort of, but that's not quite right. If you update the cf engine version for a server • there is still only on server defined in CommandBox • there is still only one .CommandBox/servers/xyz-name folder on disk • but there will be two sub folders -- one for each version.
I don't upgrade the cf engine home in place, I create a new one since the version is incorporated into the folder name. And I don't delete the old one so you can go back to it at any time and not have lost anything
FWIW, there is a setting baked into CommandBox which will change this behavior and overwrites the server home on upgrade, but I don't know if anyone uses it outside of whoever first asked me to add it, lol.
j
I should probably switch to the initial install script, yes. But the behavior you describe is how I thought it worked, but today like I said I ended up with 2 distinct server folders. The old one had 2 versioned subfolders and the new one had just the 1 versioned subfolder for the latest adobe engine it downloaded
and server list showed 2 servers with the same name
Oh you know what
b
What version of CommandBox?
j
it's because I checked out the branch to another folder and started from there but didn't change the server name
so i guess best practice is to change the server name when you check out the same project in another location and I just forgot!
i have struggled with this in the past - since the key seems to be the server name, if 2 servers are created at different folder locations, it's hard to be sure which one gets chosen because they have the same name
b
Yeah, that shouldn't be possible
The second server should have had "2" appended to it.
Again, what version of box?
j
CommandBox 5.6.1+00618