RabbitMQ Installation - Avoid service restart after enabling plugins - windows

I have a c# code that installs rabbitmq on windows machines.
After running rabbitmq-service install and rabbitmq-service start I am running rabbitmq-plugins enable rabbitmq_management.
At the end I get:
set 3 plugins.
Offline change; changes will take effect at broker restart.
I would like to know if I can avoid this restart. It's taking a lot of time and slowing the installation process. I'm pretty sure that at least one time during my tests I wasn't required to do that but I can't reproduce...

You might be running into the issue we are addressing in this pull request:
https://github.com/rabbitmq/rabbitmq-server-release/pull/82
You don't say which version of RabbitMQ or Windows you are using, nor do you say how you are installing RabbitMQ - are you using the .exe install package or the .zip package? This is all very important information to share when you ask questions about RabbitMQ (or any software, really).
When you install RabbitMQ and start it for the first time, Erlang will create cookie files. You can read this document to see where these files are created - it depends on your version of Windows and Erlang (which is why I need to know both!).
When you run commands like rabbitmqctl.bat or rabbitmq-plugins.bat, the cookie is read to establish a connection to RabbitMQ. If the cookie file in your user's home directory does not match the cookie being used by the server, you will see an "offline change" being made.
What you should do if you are using either the .exe installer or the .zip installer is, after RabbitMQ starts, be sure to copy the .erlang.cookie file from where RabbitMQ is reading it (most likely C:\WINDOWS\system32\config\systemprofile\.erlang.cookie) to your user's home directory (C:\Users\my-account\.erlang.cookie).
Then, run rabbitmq-plugins.bat enable rabbitmq_management and the plugin will be enabled at run-time.
An alternative is to pre-create the enabled_plugins file and save it to %AppData%\RabbitMQ\enabled_plugins before starting RabbitMQ the first time. %AppData% is the application directory of the admin user account you're using to install and start / stop RabbitMQ.
To enable the management plugin, that file should contain the following text:
[rabbitmq_management].
Let me know how it goes, thanks.
The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Related

Unable to start Redis in Windows Services. Error 1067: The process terminated unexpectedly

I had installed redis-3.0.504. Followed the installation instructions and now redis-server is running in the port
I had also installed redis in Windows services, but that is not running. I'm also not able to manually start the service. Getting the below error.
Any ideas to start the service?
Right-click in the service in Window Services and go to Properties.
Then go to Log On tab and select Local System account.
Click on the Ok button and start the service.
If you installed this via chocolatey, you need to add the following folder to allow the supplied redis.windows-service.conf to work:
C:\ProgramData\chocolatey\lib\redis-64\Logs
If you didn't install via chocolatey, a missing log folder is still likely to be the culprit.
The Redis port for Windows you are using has been deprecated.
As the last commit in that project suggests you can check out Memurai.
Memurai is a production grade software, actively maintained and freely available for development.

How to prevent restart dialog caused by MSI 1610 error

I have a setup created with InstallShield. During upgrade or uninstall, after Install validate process, I get a alert dialog box with the following message:
"The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup".
I found the following in the MSI log file:
MSI (s) (4C:78) [18:17:52:182]: RESTART MANAGER: Detected that application with id 4, friendly name 'System', of type RmCritical and status 1 holds file[s] in use.
MSI (s) (4C:78) [18:17:52:182]: RESTART MANAGER: Did detect that a critical application holds file[s] in use, so a reboot will be necessary.
MSI (s) (4C:78) [18:17:52:182]: Note: 1: 1610
I want to understand why I get this message and how to avoid this.
( I already checked the following registry key and it had oldmsedge.exe, I don't think it is related to this issue)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations
You can set these properties:
REBOOT=ReallySuppress MSIRESTARTMANAGERCONTROL=Disable
Pending File Renames: The FileRenameOperations key holds a list of files and resources that are waiting to be updated (and / or renamed) upon reboot / restart. This is indeed something that can trigger the warning you see. The setup found files in use that your setup tried to replace, and hence wants to restart the computer to put the new file versions in place after all locks are released (via the restart).
Windows Service: There are many things that can prevent files from being replaceable. One common problem is running services that you don't shut down properly in your setup before trying to replace files that the service has in use. Fix this to have the service in question shut down by your setup. There are mechanisms in MSI to do so (provided the service works as it should - not at all guaranteed).
Running Applications: It is common advice to shut down all normal Windows applications (not just services) that are running when you install a setup. This is to release similar file and resource locks that would cause file overwrite or registry updates to fail.
Other Locks: Files can also be locked by other mechanisms, such as malware scanners, anti virus or similar security processes. Or several other things such as backup mechanisms, ad-hoc locked files opened manually by the user (if the app actually locks the file), ACL permission problems, and worst of all: real malware. And a number of further technicalities.
Restart Manager: Windows has the Restart Manager feature to deal with this problem - files and resources that are locked and can't be updated. It is essentially a way for applications to shut themselves down in a standardized way - via an API (method calls) - so that setups and system processes can instruct the applications in question: "shut yourself down" - and then the system will restart the applications when appropriate.
Technicalities: Advanced Installer - makers of leading deployment software - has a primer on the technical aspects of making your application support the Restart Manager feature. And there is: more on RestartManager here.
Links:
In-use files not updated by MSI-installer (Visual Studio Installer project)
Windows Installer-Avoid FileinUse dialog box when Installing a package
Reboot on install, Don't reboot on uninstall
RestartManager causes worker role to restart

MQ fix pack upgrade issues

I have MQ V8.0.0.2 installed in my system and I am applying the fix pack to upgrade it to 8.0.0.5 using the silent install method. It runs successfully and finishes but dspmqver still says the version as 8.0.0.2.
It is on a Windows 7 machine 64 bit. The exe file I am using to apply the fix pack is WS-MQ-8.0.0-FP0005.exe.
I am not getting any errors in the command prompt. I followed the installation instructions IBM suggested while downloading the fix pack. I stopped the MQ manager and then ran the command WS-MQ-8.0.0-FP0005.exe -f silent_install.resp
I gave the response file name along with its path. But its still not working.
Update
On a multi-installation setup the update was being applied properly but to a different installation. To fix the problem, run amqicsdn.exe as described in Applying maintenance level updates on IBM MQ servers in the Windows maintenance Tasks section of the Knowledge Center.
amqicsdn MQPINSTALLATIONNAME=name MQPSILENT=1
This invocation sets a pointer to the installation that is to be updated.
The response file tells the installer what to do and what to install. Depending on what is set there, what you are seeing is what would be expected.
Specifically, the MQPREBOOT and MQPINUSEOK parms tell the installer whether or not to continue if a file it needs to update is in use. There are two likely outcomes here.
1) The maintenance was applied correctly but because files were in use it will not show up until after a reboot.
2) The MQPINUSEOK parm told the installer to bail out if the files were in use.
On Windows, even though the QMgr is stopped, the service continues running. Depending on the MQPINUSEOK setting that would either cause the install to fail or to complete pending a reboot.
It is worth noting that installing anything on Windows requires a couple of reboots. The very first thing before running the install or upgrade is to reboot. That ensures that the registry is saved at the current values. It also ensures that if someone else's app has gone rogue with a memory leak or other issue, it gets cleared before your MQ install proceeds.
After the install, reboot again to ensure the registry with the new MQ settings is saved. That's because if the server crashes, you want the last known good registry entry to be the one with your install or upgrade reflected in it. That also ensures the services still start as expected.
Finally, I'm unsure what "the installation instructions IBM suggested while downloading the fix pack" are but the official instructions are in the Knowledge Center section Windows: Applying maintenance level upgrades on IBM MQ servers. Among the other information you will find there is that the location for the installation log is either specified in the response file or defaults to amqicsdn.txt in your TEMP directory (%TEMP%).
Try to stop the Message Queue Manager and then run the installation command again (after modifying the silent response file). If you still face this issue, check if you have a "C:\Program Files\IBM\source\WebSphere MQ 8.0.0.5" folder created and then run the "amqicsdn.exe" file. That should resolve your issue!

Adding PostgreSQL installer to my own application installer

I created a Visual Studio 2010 installer project and added the postgresql-9.2.401-windows.exe file to it. In the "Commit" custom action, I added that file, removed any arguments and set InstallerClass to False.
Now, when I run my application's installer, the PostgreSQL setup starts up, shows its splash screen and then jumps to 100% CPU usage and starts leaking memory for a long time (certainly longer than a few minutes), after which it bails out. Running the .exe on that computer works just fine.
How should I package PostgreSQL in my installer?
Personally I don't like programs that silently install the standard PostgreSQL for Windows. It's deeply annoying to get mailing list posts from people who're asking "What's this PostgreSQL thing and why is it using 88 bajillion megabytes of RAM, I didn't ask for it, remove it now!".
(Yes, I'm mostly talking about a certain annoying gambling card-counting program with the initials PT whose name I will not mention directly).
If you're going to bundle PostgreSQL it'd be great if you could use a non-default port and non-default data directory. If you install a service to auto-start it, don't use the default service name postgresql-[version] but something like myapp-database or myapp-postgres.
This is all done much more easily if you just bundle the PostgreSQL binaries in your installer then create the service yourself with your installer tools or via sc.exe. You may choose to simply pg_ctl start/stop the server from within your program, though this requires some thought about access permissions to the data directory.
The downside is that when there are PostgreSQL updates you need to update your installer. On the other hand, you probably don't want people upgrading PostgreSQL independently of your software updates.
I suggest using the .zip binaries from here and bundling them into your installer directly.
If you really must use the executable installer the documentation contains instructions on silent installation.

Install a Apache/MySQL/PHP web application locally

We have a web application that is based on Apache, MySQL and PHP. I want to make that available as a desktop application for windows also, installed via MSI. A small .NET application starts a modified xampp package that we deploy and then opens an embedded Chromium-based browser.
Questions:
How do I ensure that I am able to modify the Apache/MySQL/PHP config on run time? The files are stored in Program Files, and UAC of course does not allow me to change them without "Run as administrator". Is there a way to make these files editable during setup? Otherwise I would have to figure out how to start Apache/MySQL with custom config files from a temp directory.
How do I tell the installer to add Apache & MySQL to the firewall exception list, or how do I tell the firewall that applications that listen only locally are not a threat?
I realized I do not want a dirty hack here and tried to do it "right":
I modified the configuration of Apache and MySQL so that everything that changes lies in %APPDATA%. The configuration files are passed as command line arguments.
The current version of Advanced Installer allows Firewall rules to be set on installation.
Actually it wasn't that hard to change the config as I thought it would be and I learned some bits in the process...
I am unsure how this might be helpful, but take a look at inno setup it's free tool to deploy software, and it allow to make custom installation script using pascal, by putting some effort i hope , you can install wamp, add firewall restrictions etc.

Resources