I am using rrdtool-1.4.7-1 version of rrd tool.
In normal case, If all RRD data has been flushed then "clean shutdown; all RRDs flushed message" displays in syslog logs.
Below message will show when shutdown is performed.
Mar 21 10:36:28 rrdcached[52232]: caught SIGTERM
Mar 21 10:36:28 rrdcached[52232]: starting shutdown
Mar 21 10:36:29 rrdcached[52232]: clean shutdown; all RRDs flushed
Mar 21 10:36:29 rrdcached[52232]: removing journals
Mar 21 10:36:29 rrdcached[52232]: goodbye
but in problematic case, below message display and failed to stop rrd cached.
Mar 21 10:36:28 rrdcached[52232]: caught SIGTERM
Mar 21 10:36:28 rrdcached[52232]: starting shutdown
I have also checked on top logs and flushing is in progress on directory.
Please let me know in which case rrd cached daemon will fail to stop?
Related
I tried to install and start the Tomcat on my AWS EC2 instance.
However, I failed to run tomcat server after installed it.
I followed the following article for that
https://blog.devops4me.com/aws-tutorial-how-to-install-tomcat-in-aws-ec2-install/
And after finished step 6, and reloaded tomcat server, I tried to restart tomcat service like step 7. However, my terminal showed as below:
Feb 14 20:17:07 ip-172-31-54-104.ec2.internal systemd[1]: tomcat.service: control process exited, code=exited status=203
Feb 14 20:17:07 ip-172-31-54-104.ec2.internal systemd[1]: Failed to start Tomcat Server.
Feb 14 20:17:07 ip-172-31-54-104.ec2.internal systemd[1]: Unit tomcat.service entered failed state.
Feb 14 20:17:07 ip-172-31-54-104.ec2.internal systemd[1]: tomcat.service failed.
Feb 14 20:17:10 ip-172-31-54-104.ec2.internal systemd[1]: [/etc/systemd/system/tomcat.service:22] Missing '='.
Feb 14 20:17:22 ip-172-31-54-104.ec2.internal systemd[1]: tomcat.service holdoff time over, scheduling restart.
Feb 14 20:17:22 ip-172-31-54-104.ec2.internal systemd[1]: tomcat.service failed to schedule restart job: Unit is not loaded properly: Bad message.
Feb 14 20:17:22 ip-172-31-54-104.ec2.internal systemd[1]: Unit tomcat.service entered failed state.
Feb 14 20:17:22 ip-172-31-54-104.ec2.internal systemd[1]: tomcat.service failed.
I don't really understand how this work, and tried to search error on internet, but still doesn't have any clue of how to solve this problem, if anyone can give me a hint, that would be great, thank you!
Previously, I had a django application/database on the same server.
Now I have made one server with application, one server with database(Debian 11; Postgresql 12.9 (Install via Homebrew))
Problem: after a few hours there are problems with connecting to the database...
postgres log:
2022-01-24 23:27:00.315 UTC [9982] LOG: received smart shutdown request
2022-01-24 23:27:00.323 UTC [9982] LOG: background worker "logical replication launcher" (PID 9996) exited with exit code 1
2022-01-24 23:27:00.324 UTC [9991] LOG: shutting down
2022-01-24 23:27:00.344 UTC [9982] LOG: database system is shut down
/var/log/syslog:
Jan 24 23:27:00 d systemd[1]: Stopping User Manager for UID 1000...
Jan 24 23:27:00 d systemd[8909]: Stopped target Main User Target.
Jan 24 23:27:00 d systemd[8909]: Stopping D-Bus User Message Bus...
Jan 24 23:27:00 d systemd[8909]: Stopping Homebrew generated unit for postgresql#12...
Jan 24 23:27:00 d systemd[8909]: dbus.service: Succeeded.
Jan 24 23:27:00 d systemd[8909]: Stopped D-Bus User Message Bus.
Jan 24 23:27:00 d systemd[8909]: homebrew.postgresql#12.service: Succeeded.
Jan 24 23:27:00 d systemd[8909]: Stopped Homebrew generated unit for postgresql#12.
Jan 24 23:27:00 d systemd[8909]: homebrew.postgresql#12.service: Consumed 1min 22.614s CPU time.
Jan 24 23:27:00 d systemd[8909]: Removed slice app-homebrew.postgresql.slice.
Jan 24 23:27:00 d systemd[8909]: app-homebrew.postgresql.slice: Consumed 1min 22.614s CPU time.
Jan 24 23:27:00 d systemd[8909]: Stopped target Basic System.
...
I connect to server via terminal from my local computer. I see only my sessions(loginctl list-sessions), if I kill it, then postgresql will fall again.
I need to create a user that will be permanently active? How to do it right?
I have Django site that have custom management command that sync data from one system to database every 5 min. In the script for the command there is serveral log messages. When I manually execute the command, everything is working fine and each log message is outputed to stdout/stderr at the time as it should be. No problem here.
For running the command every 5min, I setup systemd service and timer and it is working as it should be with one minor thing. All messsages from the script are logged in systemd at the time when the script execution ended, not at the time when they happened. The script is usually running about one minute and log message is outputed sporadically as each subtask in the script has ended. In my case, systemd logged all messages as if they happend at the same time, more precisely at the end of execution.
So, log is looking something like this and pay attention on timestamp of messages.
Jul 16 09:20:01 SmallServer systemd[1]: Started DjngoSite Sync daemon.
Jul 16 09:20:40 SmallServer python[21265]: Task 1 completed
Jul 16 09:20:40 SmallServer python[21265]: Task 2 completed
Jul 16 09:20:40 SmallServer python[21265]: Task 3 completed
Jul 16 09:20:40 SmallServer python[21265]: Task 4 completed
Jul 16 09:20:40 SmallServer python[21265]: Sync ended
But, I want to look like this:
Jul 16 09:20:01 SmallServer systemd[1]: Started DjngoSite Sync daemon.
Jul 16 09:20:11 SmallServer python[21265]: Task 1 completed
Jul 16 09:20:15 SmallServer python[21265]: Task 2 completed
Jul 16 09:20:22 SmallServer python[21265]: Task 3 completed
Jul 16 09:20:39 SmallServer python[21265]: Task 4 completed
Jul 16 09:20:40 SmallServer python[21265]: Sync ended
I cannot figure out is this issue with systemd or with Django. I am writing messages to the stdout as it is shown in documentation.
Python is buffering what is written to stdout.
What helps is to set enviromental variable PYTHONUNBUFFERED=1
Enviromental variable PYTHONUNBUFFERED
Python -u flag
With Python version 3.7 was changed that the text layer of the stdout and stderr streams now is unbuffered.
I'm working on making a REST API for my research lab's database. I'm using the Django REST framework and I've gotten everything running smoothly on my local machine. All my code is in its own branch in our Mercurial repo. When I switch branches on our server, the website crashes with:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root#localhost and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error
log.
The error logs on our server look like this:
[Tue Feb 03 12:55:56 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 03 12:55:56 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Feb 03 12:55:56 2015] [notice] Digest: done
[Tue Feb 03 12:55:56 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Feb 03 12:56:11 2015] [error] avahi_entry_group_add_service_strlst("Lee on [server name]") failed: Local name collision
(this sort of error repeats many times)
[Tue Feb 03 12:56:13 2015] [error] avahi_entry_group_new() failed: Too many objects
(this error repeats many times.)
I've tried Googling the avahi errors to no avail. Anyone have any insight?
Because of the "too many objects" part of the error, I thought that it might somehow be related to not setting the pagination settings for the API. I only have a couple test objects on my local dev version of the database, but the actual database has tens of thousands. I set up pagination and tried again but it didn't change anything.
Turns out the culprit was not having the djangorestframework package installed for the correct version of Python on the server!? Hopefully this helps someone later down the line.
My Django WEB Application fails to launch all of a sudden and out of the blues.
It was working fine until yesterday in production.
I am not able to figure out where the problem is. It could apache or mod_wsgi or windows but at the moment I have no clue.
I have tried to reinstall all the python libraries/prerequisites etc. but the problem persists nevertheless.
I am serving the WEBApp at Apache Port 8999 and When I access the WEB App, the browser fails to show any error. It just keeps trying to open the page and in the status bar I just see the Waiting for message.
If I see the netstat results then I see the following
C:\Documents and Settings\admintemp>netstat -an | find "8999" TCP
0.0.0.0:8999 0.0.0.0:0 LISTENING TCP 172.18.148.156:8999 10.107.226.88:1826 ESTABLISHED
This connection remains established forever and nothing happens. Internet Browser just seems to try to keep opening the Web App and it appears as if it is waiting forever.
The only thing i see in Apache logs is this
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
[Fri Jun 21 18:34:32 2013] [notice] Server built: Jan 28 2012 11:16:39
[Fri Jun 21 18:34:32 2013] [notice] Parent: Created child process 3876
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Child process is running
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Acquired the start mutex.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting 64 worker threads.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting thread to listen on port 8999.
[Fri Jun 21 18:34:43 2013] [error] C:/Program Files/App_Logic/logic_apps/logic_apps\\..\\logic_apps
I also noticed in the Windows Event Viewer logs (Application Logs) the following message but I am not sure how (and if) this could be related to my problem at hand. This message seems to shows up once for everytime i access the Web App.
Application popup: Microsoft Visual C++ Runtime Library : Runtime
Error!
Program: C:\Progr...
R6034 An application has made an attempt to load the C runtime library
incorrectly. Please contact the application's support team for more
information.
Exact screenshot of above error message is at http://imgur.com/hijiKv8
Please note that as part of my analysis I have tried
Accesing the apache page at http://127.0.0.1:8999 does show me the It Works ! message
Running the WEB App using the Django Development server and it launches fine.
Changing the wsgi.py file and when I introduce errors in the file deliberately, accessing the web app does complain with the relevant.
The application is installed on Windows Server 2003 SP1 and there are no automatic updates schedules on this machine so I am not suspecting that a update would have caused this problem. I also saw the Windows Update log and there was nothing installed recently.
The application is based on following Python Libraries as prerequisites
httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
python-2.7.3
Django-1.4.3
psycopg2-2.4.6.win32-py2.7-pg9.2.2-release
cx_Oracle-5.1.2-10g.win32-py2.7
PIL-1.1.7.win32-py2.7
python-ldap-2.4.10.win32-py2.7
south-0.7.6
xlrd-0.9.0
xlwt-0.7.5
mod_wsgi.so
I have tried with the WSGIApplicationGroup %{GLOBAL} directive and setting the log level to debug and info but the resulting logs don't give any additional information.
I have posted apache debug level log at http://dpaste.com/1268653/
I have posted apache info level log at http://dpaste.com/1268660/
Both these logs were taken after a fresh restart of apache and then the application hanging and until I stopped apache and copied the logs.
I also tried running the Hello World Application as documented at https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines and it worked fine.
I still remain clueless. Appreciate if you could guide me what else I could do to get more details of the issue.
Appreciate if someone could guide me with respect to what more I can do to solve this problem or get more information to get to the root of this.
I was able to solve this issue in the end.
The post at Runtime error R6034 in embedded Python application led me to a solution.
Thanks to Graham Dumpleton and others who were helping me offline to get this issue solved.
It was rather cheeky in the end, a conflicting version of msvcr90.dll
I removed the IBM Bit from the path and it works fine now.