My situation of my apache2 service now :
main process was down, only child processes were running
How can I get value of main process when it dead or active ?
Related
I have configured xinetd to launch NSCA when a connection on port 5667 is made.
I can start xinetd by command line as root and things work correctly:
/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
I can send a test NSCA message to myself, and /var/log/messages shows NSCA daemons getting spun up, writing to nagios.cmd pipe, etc.
But, when run by systemctl start xinetd, my test messages fail with "Server closed connection before init packet was received"
The xinetd service appears the same in ps -ef | grep xinetd regardless of which way it's run.
I don't think its a user or permissions problem, as it should be running as root.
Not having much luck getting NSCA or XINETD to log any relevant info on why its attempting to spin up the NSCA daemon but immediately exiting...
See below for my nsca file for xinetd
service nsca
{
flags = REUSE
socket_type = stream
wait = no
user = root
group = root
server = /usr/sbin/nsca
server_args = -c /usr/local/nagios/etc/nsca.cfg --inetd
log_on_failure += USERID
disable = no
only_from = <list of allowed hosts>
instances = UNLIMITED
per_source = UNLIMITED
cps = 5000 0
}
Solution:
I learned that when systemd launches a process, its in a clean slate environment. So, anything run by xinetd that requires environment variables needs those env vars passed in xinetd's environment file (a field in /lib/systemd/system/xinetd.service called "EnvironmentFile"). For me that lives at: /etc/sysconfig/xinetd
To find which vars I need, in the bash window in which running xinetd manually was WORKING, 'env' spit out all the vars.
Copied them all into /etc/sysconfig/xinetd, then 'systemctl restart xinetd' and all worked.
Then just through process of elimination determined the envvar I was missing was:
LD_LIBRARY_PATH=:/usr/local/libmcrypt/lib
While giving the command st2ctl reload, getting unauthorized packages and st2 components are not running.
Please find below..
2020-02-11 05:45:28,065 INFO [-] Registered 0 configs.
st2 components status
st2actionrunner is not running.
st2api is not running.
st2stream is not running.
st2auth is not running.
st2garbagecollector is not running.
st2notifier is not running.
st2resultstracker is not running.
st2rulesengine is not running.
st2sensorcontainer is not running.
st2chatops is not running.
st2timersengine is not running.
st2workflowengine is not running.
st2scheduler is not running.
root#120098fcfd22:/# st2ctl status
I have created a systemd service like way any interruption triggered to running process then it has to restart itself. but service shows its status as running (Used systemctl status x.service) even after process is exited (which is mentioned in exec_start).
Below is my service script
{
[Unit]
Description=xserverd
After=syslog.target rsyslog-x.service systemd-modules-load.service
Requires=rsyslog-x.service systemd-modules-load.service
[Service]
Type=forking
ExecStart=/opt/bin/xserver
Restart=always
RestartSec=2s
RemainAfterExit=no
RestartPreventExitStatus=SIGINT
KillMode=process
TimeoutSec=300s
[Install]
WantedBy=multi-user.target
}
/opt/bin/xserver is a C executable which 777 permission. Added signal handler for SIGINT and SIGSEGV. SIGINT is to say proper exit from user. SIGSEGV to log backtrace to our custom log file. Whenever process receives these signals it will exit with
{
exit(EXIT_FAILURE)
}
For Type=forking, systemd assume the child or child of child of the start command is the daemon process.
Change it to simple if your daemon does not go this way.
I'm root and
I forgot it
What can I do now?
I tried to reinstall arangodb, remove all databases but after new installation old password still exist
service arangodb3 stop
/usr/sbin/arangod --server.authentication false
and then
require("#arangodb/users").replace("root", "my-changed-password");
exit
service arangodb3 restart // **VERY IMPORTANT STEP!!!**
//if you don't restart the server everyone can have access to your database
Start the server arangod with the option --server.authentication false. This will disable authentication, so that you can access the databases without password. If you are asked for credentials in arangosh or the web interface, use root as username and a blank password. You can then change the password of user root (in the web interface: USERS > root > Change Password).
It is advisable to bind the server to --server.endpoint tcp://127.0.0.1:8529 and not 0.0.0.0 with authentication turned off, so that no one from outside can access the unprotected database, but only you locally on the server (you can also bind it to a network address, but make sure that the port is not open to the public in that case).
I'm running ArangoDB3 as a service on Ubuntu, and I wasn't able to figure out how to pass the --server.authentication false or --server.endpoint tcp://127.0.0.1:8529 parameters to the arangod process.
I made it work by changing the same values in /etc/arangodb3/arangod.conf.
Step 1:- Stop running instance of arangodb
sudo systemctl stop arangodb3
Step 2:- Start arangodb with disabled authentication
sudo /usr/sbin/arangod --server.authentication false
Step 3:- Start arango shell in new terminal
arangosh
Step 4 :- Change password of root in arango shell
require("#arangodb/users").replace("root", "new-password");
Step 5 :- Close arango shell
exit
Step 6 :- Stop arangodb unautheticated service in the previous terminal
CTRL + c
Step 7 :- Restart arangodb service
sudo systemctl start arangodb3
As part of the deployment process of a Glide project (http://glide-gae.appspot.com/docs/intro step 3 of 2nd section) you need to authenticate using oauth2. My browser popped up with the token as expected but the process didn’t wait for me to copy the code in, it just carried on with the following error...
22:30:12.713 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon is busy, sleeping until state changes.
22:30:12.733 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
22:30:12.734 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 12557). The daemon log file: /.gradle/daemon/1.8/daemon-12557.out.log
22:30:12.739 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 14: received class org.gradle.launcher.daemon.protocol.CloseInput
22:30:12.740 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] Received IO message from client: CloseInput[id=069864b2-2948-4a9d-abea-0705274136a1.2]
22:30:12.741 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] Closing daemon's stdin at end of input.
22:30:12.742 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] The daemon will no longer process any standard input.
22:30:12.747 [INFO] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=3901cff0-8d50-41b6-9459-e31f7b78f1e3,javaHome=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home,daemonRegistryDir=.gradle/daemon,pid=12557,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-Xmx512m,-Dfile.encoding=UTF-8]
Please enter code: Encountered a problem: No line found
Please see the logs [/var/folders/c8/vx2jf50j68x1z3_pysy6kxjm0000gp/T/appcfg2389447403250678065.log] for further information.
Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a user interrupt.
----- End of the daemon log -----
org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.8-bin.zip'.
What can I do to be able to deploy my application? How can I force the process to wait for me to enter the code?
If that's (glide deploy) not working for you, the easiest option is to export the app as a standard gradle project and then execute the gaeUpdate task.
glide -a somedir/yourapp -o where/you/want/to/export/app export
Note that the export is command at the end, -o tell the location where it should be exported.
Then from the exported project run: gradle gaeUpdate
A work around is to manually set your credentials in the GAE build.gradle file.
Update the following file:
/glide/install/generated/app-name/build.gradle
appcfg {
email = ‘email-address'
password = ‘password'
app {
id = ‘app-id'
}
}
This means that the values from the __glide.groovy file are ignored, but at least you can get the application deployed