Elasticbeanstalk stopping procfile services during deploy - deployment

Hi I am struggling to figure out how to prevent services other than Web running during an elastic beanstalk al2 deploy.
I've realised that all processes listed in the procfile are created as services in Linux, but using
systemctl stop myprocfilename
does not worm because of eb's nature to automatically restart anything defined in procfile the service is automatically restarted straight away.
I also can't disable the service due to the policy kit setting which I don't know how to change.
Any help would be appreciated

Related

How do I make the web server run "constantly"?

I have a Play application at ec2 which I just have deployed. Everything seems fine, it's visible in the Internet. However, it seems fine only as the server is working. What I mean is that when I connect to ec2 via ssh and then launch the server by play run, only since then it's visible in the Internet and works fine. I know it's obvious. But I tried to run it in background by play run& and it never worked:
$ play run &
[1] 2470
$ jobs
[1]+ Stopped play run
$ play run&
[2] 2494
$ jobs
[1]- Stopped play run
[2]+ Stopped play run
Have I been doing something wrong? But what and what should I do?
You should prepare your application for production as discussed in the docs. You might also consider running it behind Nginx or Apache or another web server.
Besides also recommending running production using a reverse proxy with Apache or Nginx. (Pretty much the de facto standard these days on Linux), you can also deploy it using the play dist command. Basically, it will compile your code into a package and put it into a zip file.
You can unzip your zip file wherever you want to run your application then you can just run it with:
$ ./<yourapplication>/bin/<yourapplication> -Dhttp.port=<whichever port you want to run it at> &
Make sure you have the java executable in your PATH and this method will avoid having any dependency with the Play application itself. Eventually, you'll probably want to create a Linux init script if you need to deploy your app into multiple servers say behind a load balancer -- So you can your just run service <your-app> start or service <your-app> stop
More info here: http://www.playframework.com/documentation/2.2.x/ProductionDist.
Also, make sure you look at the latest play documentation as it gets updated pretty often.

services setup project showing Error

I create One Windows services to scheduling SQL backup,
Its runs perfectly when i install it by visual studio command prompt, installutil services.exe,
Now i need to make it setup so, i can give this services to my client also,
I found http://support.microsoft.com/kb/816169 this link very userful
i create setup file, and it also install services,
but when i start services by right click on service,
it start perfectly in my PC but in other Pc its shows error
kindly help me to create setup file for services
I think you see that message when the service is started by the system but stops quickly without completing the protocol message/event exchange. Your service is starting and then just finishing, so you need to figure out what it's doing, even if it's just "On Exception go to end of program".

How can I configure JBoss so that I have to manually start and stop the server after deploying?

I want to configure this so that it doesn't restart automatically, but I have to manually start and stop it. Is this possible?
I am not sure if I understand you correct: you just don't want to hot deploy application. You would like that application should be deployed only during starting the JBoss server?
If yes, you can disable the hot deploy service just by removing the hdscanner-jboss-beans.xml from deploy directory.
PS. It works for JBoss AS 5.1.

Wix: The service cannot be started during installation

I'm having a problem with Wix Service as the service cannot be started during install progress. It throws the error:
Error 1053: The service did not respond to the start or control request in a timely fashion
I've tried with both [WIX_ACCOUNT_LOCALSYSTEM] and [WIX_ACCOUNT_LOCALSERVICE] but no one of them work.
But there is weird here as I have an installer which using ClickOne, it includes the same service component as the one I have been using in Wix. The ClickOne installs service just fine (using InstallUtil.exe), so it proves the account has right to start a service.
Then, I uninstall the software (installed by ClickOne), and running the Wix installer again, the service starts well now. I don't know the reason why?
I'd like to put some flows for more clearly:
1- On a fresh machine
2- Running Wix software installer --> the service cannot be started and throwing error message --> Cancel install
3- Running ClickOne software installer --> service starts well --> Uninstalling software
4- Running Wix software installer --> service starts well
Also note that, I've tried 2 times on 2 fresh machines but it's the same. Anyone can shed some light on this weird behavior? Or anything I should verify against?
Thanks in advance,
Thank you #Stephen Connolly, #Alexey Ivanov, #Cosmin Pirvu for your comments.
I'd like to add your comments above as the answer.
Using CheckAsm, a great tool to verify the assembly dependencies
Looking at the log information in Event Viewer for anything could stop the service starting (i.e. timeout, services dependency ...)
Verifying all stuffs would be needed for service operations. They should be available once installation completed (i.e. configuration, registry, working folder ...)
If the installer is installing files to the GAC using the Windows Installer tables, the dependencies won't be available when the installer runs the StartServices action

JBoss 5.1.0 disabled HDScanner, undeploying post restart doesn't work

I have disabled the HDScanner bean (by removing JBOSS_HOME/deploy/hdscanner-jboss-beans.xml) in JBoss 5.1.0 so that I must do all deployments to running instances through Twiddle (applications found in the deployment directory are automatically deployed on startup).
After I have done this I can deploy and undeploy a war by using the following commands:
twiddle.sh -s localhost invoke "jboss.system:service=MainDeployer" deploy "file:/path/to/my.war"
twiddle.sh -s localhost invoke "jboss.system:service=MainDeployer" undeploy "file:/path/to/my.war"
This works fine.
However, if I restart JBoss between the deploy and the undeploy, when I try to undeploy the app using twiddle, the app remains deployed and the JBoss logs display :
2011-04-18 14:30:41,318 WARN [org.jboss.deployment.MainDeployer] (WorkerThread#0[10.21.4.61:43700]) undeploy 'file:/path/to/my.war' : package not deployed
Am I doing something wrong, expecting something that's not possible, or is this a bug in JBoss?
If I am doing something wrong, what is the correct way to undeploy an app that has been deployed using twiddle on an instance of JBoss that has been subsequently restarted?
Edit
Without looking at the source code of JBoss, it seems to me that apps that are deployed on startup are managed in a different place from those deployed through Twiddle. Ie if an app is deployed at startup it is not known of by the mechanism accessed through Twiddle, hence the "package not deployed" error.
So, is there a way to access this other deployment manager through Twiddle such that apps that are present at startup can still be undeployed?
I have done a lot of testing on this, and basically apps that are found at startup are (rightly) considered to be part of the JBoss 'core' and are therefore deployed automatically as part of the startup process. This applies for things such as the jmx-console, and therefore applies for other .wars too. Whether through design or through consequence, these resources that have been automatically deployed during startup cannot be managed by twiddle invokations.