Calling url when apache service starts - apache2

Is it possible to call a url when the apache service starts?

Why not just add a line to your apachectl script to call a URL via wget or similar ?
I presume you're doing this to test startup behaviour ? You can check the error code from wget (or whichever tool you use) and then take appropriate action.

Related

systemd ignores services from overlayFS

I want to build a system with applications on another partition, an app-filessystem. All binaries, configs and service files which belong to the application should be in the app-fs.
I'm using the following versions: kernel 4.9.x, systemd v234.
The app-partition is mounted at /opt, this includes following files:
/opt/usr/bin/app-binary
/opt/etc/systemd/system/multiuser.target/link_2_app.service
/opt/lib/systemd/system/app.service
Here is the service file:
[Unit]
Description=The application description.
After=syslog.target basic.target
[Service]
ExecStart=/opt/usr/bin/app-binary
Type=simple
[Install]
WantedBy=multi-user.target
To synchronize the files with rootfilesystem I created 2 overlays, this could be the /etc/fstab entries (sorry for format, one line didn't work):
/dev/app-partition /opt auto defaults,x-systemd.mount 0 2
overlay /etc overlay defaults,x-systemd.mount, x-systemd.after=opt.mount,lowerdir=/etc,upperdir=/opt/etc,workdir=/work/etc 0 2
overlay /lib/systemd/system overlay defaults,x-systemd.mount,x-systemd.after=opt.mount,lowerdir=/lib/systemd/system,upperdir=/opt/lib/systemd/system,workdir=/work/lib 0 2
This is handled before local-fs.target is reached.
Result
I can start the app successfully but manually with systemctl start app.service. The status with "systemctl status app.service" says it is enabled. But the app is not starting at boot time. Systemd does not give a message about trying to start the app.
Questions
Is there a way to debug this behaviour? When does systemd check the service files? Is there a way to trigger it again? Are there other ways to handle this use case with systemd?
systemd is checking the unit files once at start, an init script which is creating the overlayFS before systemd startup can handle this use case.
Another idea (but not tested) would be: systemctl daemon-reload
systemctl daemon-reload
I test this not work.
In my situation . I use systemd-networkd,and I overlay
For disabling autostart of services seems using
ConditionPathIsSymbolicLink=#OVERLAY_UPPER_LAYER#/etc/systemd/system/../XX.service
as additional condition in service drop-in works

How to fix SERVICE_PAUSED error on starting nssm server

So I need to run a custom server. It worked on other machines, but not on mine (all of them are on Windows).
My input:
nssm start custom-server
Error message:
custom-server: Unexpected status SERVICE_PAUSED in response to START control.
I tried to re-start it, but got the same message.
Use the following instructions to change I/O redirects:
nssm set [SERVICE_NAME] AppStdout [APP_PATH_INSTALL]\logs\service.log
nssm set [SERVICE_NAME] AppStderr [APP_PATH_INSTALL]\logs\service-error.log
Check the service log files to find the failure.
In my case, the failure was caused by a dependency on Python libraries.
As Garric15 states it is probably your install command.
This could be for example a StdOut redirect to a path / file that does not exist on your local machine.
Look in the Application event log for errors where the source is nssm around the time you installed the service.
The reason is because firewall is blocking the software which you are running as a service, start first software separately, it will ask you to add to firewall exclusions , then you can use it via nssm
Some scenario
App directory not provided or doesn't exist
nssm nssm set xyz-service AppDirectory "D:\Work\ShoppingKart"
File which is given for service may be corrupted (rebuild code)
The application trying to run is not proper or corrupted. Try to run without windows service once.
Program (.exe) file path not found (in this case look for the solution, or else give full path, if java not found even if it is there in env, just add full path)
I solved it by using no mws (Managed Windows Service?) release,
ex.
gogs_0.12.10_windows_amd64 works
gogs_0.12.10_windows_amd64_mws not working
The issue for me was there had been a Java update on my machine. The JAVA_HOME environment variable was now pointing to an invalid directory (i.e. the old Java version). Just needed to update the JAVA_HOME path and restart the solr services to fix it.
I was attempting to configure rclone as a windows 10 service. I fixed it including the rclone.conf archive inside the rclone folder.
In my case, the problem was that after the service was installed using nssm.exe, the program name was changed. This caused service to always go to paused state after start or restart the service, using either services.msc or nssm.exe command line.
Editing service nssm.exe startup parameters solved the problem for me.

Why am I getting the following error with Apache Commons Daemon ( 'specified service does not exist' )?

I'm attempting to run Apache Commons Daemon tool (on Windows 7), and when I double-click on LoggerServicew.exe (which was originally prunmgr.exe in the Apache Deamons folder) , I am getting the following error message :
What is meant by "as an installed service" ? How do I make this an installed service ?
My directory :
See Apache Procrun - this details the exact usage.
Here is a quote from their page regarding installing a service:
Prunsrv is a service application for running applications as services.
It can convert any application (not just Java applications) to run as
a service.
Each command line directive is in the form of //XX[//ServiceName]. If
the //ServiceName parameter is omitted, then the service name is
assumed to be the name of the file. For example if the application is
renamed as TestService.exe, then the default service name is
TestService. The available command line options are:
//IS Install service
Starting with version 1.0.8 a more traditional command line can be
used in the form: command [ServiceName].

DSpace error with oai import

After configuring my DSpace server, its working correctly but when I look at the OAI identify page (http://repositorio.puce.edu.ec/oai/request?verb=Identify) so we can be harvested, it says that the repository is localhost instead of my URL. I investigated and found out that to update this, I have to run this command: dspace/bin/dspace oai import -c but when I run that command is gives me the following error: Solr server (http://repositorio.puce.edu.ec/solr/oai) is down, turn it on.
I can see the Solr Admin (it can't be seen from the outside because of security reasons) so I don't know what should be turned on or how to do it?
Thanks for the help.
I encountered this error in the past.
Looking at my oai.cfg file, I used localhost for some settings and my public URL for others.
solr.url=http://localhost/solr/oai
# OAI persistent identifier prefix.
# Format - oai:PREFIX:HANDLE
identifier.prefix = repository.library.georgetown.edu
# Base url for bitstreams
bitstream.baseUrl = https://repository.library.georgetown.edu
If you need to make a config change, be sure to clear the cache after restarting service.

Google compute engine returned 399 internal server error

Google compute engine console return 399 error code already asks my question but the solution is not as suggested there. Since the URL is little old starting a new thread.
I am trying to do a wget using:
wget https://console.developers.google.com/m/cloudstorage/b/m-lab/o/ndt/2012/05/23/20120523T000000Z-mlab1-ams01-ndt-0000.tgz
I see the error:
Resolving console.developers.google.com (console.developers.google.com)... 216.239.32.27
Connecting to console.developers.google.com (console.developers.google.com)|216.239.32.27|:443... connected.
HTTP request sent, awaiting response... 399 Internal Server Error
2014-08-26 20:02:18 ERROR 399: Internal Server Error.
I am new to Linux commands so wanted to know if am missing something obvious.
The address works when I use Chrome downloader but fails with wget with me as well
I have never seen this behaviour before
You can also use cURL to download files, I used the -v switch and got a dns error(no idea why)
curl -v http://console.developers.googlO.com/m/cloudstorage/b/m-lab/o/ndt/2012/05/23/20120523T000000Z-mlab1-ams01-ndt-0000.tgz
We cannot download with traditional tools we have to use gsutil utility provided by google, using which automation is possible.
You need to use the following URI pattern:
http://storage.googleapis.com/<bucket>/<object>
In this case, you can download that file using the command:
wget http://storage.googleapis.com/m-lab/ndt/2012/05/23/20120523T000000Z-mlab1-ams01-ndt-0000.tgz

Resources