-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server freezes after restarting monitorix #462
Comments
I'm sorry, I don't understand you. You say "Reboot works OK" but then you say "Reboot crashed the server.".
Running Monitorix under Apache is well tested and I've never heard of any problems on it.
I've never seen those messages either. What's your Monitorix version? |
I'm sorry for the confusion. Here is the corrected text: |
Monitorix version: 3.15.0-izzy1 Installation: |
Monitorix logs: |
Beside some rare iptables messages and the error in the Can you paste here the your |
This php-fpm error is strange as the statistics for it are present in Monitorix: The default config files were not changed. All my changes are in 99-server.conf: |
I don't see anything wrong in your configuration file. |
I always thought that greylist option was optional, as I don't use graylisting. Will make a diff with /etc/monitorix/monitorix.conf to see if anything else is missing or is off. |
It's optional indeed. Such message was wrong should have gone to another issue. My fault. Sorry for the noise.
I've just received the PayPal notification. |
I'm not sure but it looks like the service unit of Monitorix in your Ubuntu is not being executed correctly by your systemd, or it creates somehow malfunction in your system. I'm using different versions of systemd on different servers (none of them are Debian or Ubuntu) and all my Monitorix instances are running fine. The newest systemd version I have is 254. What systemd version you have there? @IzzySoft, have you seen a similar problem in your Debian/Ubuntu systems? |
"apt list --installed" returns "systemd/now 249.11-0ubuntu3.11" |
This is the unit file of Monitorix 3.15 running on my Fedora 39:
Compare it with yours, it should be the same. |
This exists: /etc/init.d/monitorix |
"apt install monitorix --reinstall" didn't help. File monitorix.service is still missing. |
Oh, then your Monitorix installation is using a System V init script on a systemd. Well, most systemd accept backwards support for the System V init scripts, but perhaps you need to install a specific systemd module for this in your Ubuntu. I'll wait to see what @IzzySoft says on this, because he is the person who packages and maintains the Izzy repository. From where you downloaded your Monitorix version. |
No, I haven't. But neither I have ever removed disks while the system was running – apart from "real removables" which in turn I've never added to my Monitorix configs. @DSmidge I might have missed it, but did you state where you installed Monitorix from? Official repos, my repo …? |
Ah!, @IzzySoft to the rescue! 👍 |
I used this commands a while (=years) ago: |
Maybe it was installed on Ubuntu 18.04. Not sure. |
I've just checked my SPEC file (maybe for the next release, I should align that a little closer to yours, @mikaku) – the entire
If I'm not mistaken, the SPEC file would have placed it below |
Yes, this is the location on Ubuntu: /usr/share/doc/monitorix/monitorix.service |
@IzzySoft, keep in mind that the .spec file of Monitorix for Fedora is very different to the .spec file that comes with the standard tar.gz of Monitorix. Fedora has very strong rules on how to use RPM macros, etc. Check the following two links: https://bodhi.fedoraproject.org/updates/?search=monitorix |
I referred to the one shipping in the tarball:
while mine takes everything from |
You might want to try to copy the file
Let us know if that worked. |
It's working. I used these commads: So was my installation broken or wasn't the service files not properly installed? |
Well, perhaps systemd no longer supports System V init scripts, or at least, it no longer includes the plugin to support them by default. @IzzySoft, that would mean that the .spec in docs/ that forms the base for your .deb packages could be no longer workable for modern Ubuntu versions. |
@mikaku then maybe we have 3 options here. In order of preference:
Going with 1. maybe there could be a proper message shown at install. I've seen that with other packages, but have no idea how to accomplish that. Going with 2. might break it on some "legacy devices" still running rather old releases of Debian/Ubuntu. Going with 3. would only be the very last resort as it would rob those people of 1. of keeping at least their Monitorix up to date. I don't know (not yet investigated that), but there might be a 2a) where Here's what my current %post
####
# Insert start script into autostart
####
set -e
if [ "$1" = "configure" ]; then
if [ -e /etc/init.d/monitorix ]; then
/usr/sbin/update-rc.d monitorix defaults 99
/etc/init.d/monitorix start
fi
#if [ ! -e /var/www/monitorix ]; then
# if [ -d /var/www ]; then ln -s /usr/share/monitorix /var/www/monitorix; fi
#fi
fi
mkdir -p /var/lib/monitorix/www/imgs
chown -R www-data:nogroup /var/lib/monitorix/www/imgs
chmod 0775 /var/lib/monitorix/www/imgs Detection could go by if [ "$ID" = "ubuntu" -o "$ID_LIKE" = "ubuntu" ]; then
if [ "$UBUNTU_CODENAME" = "focal" -o "$UBUNTU_CODENAME" = … ]; then
# supports systemd, so use that
else
# still supports SYSTEMV, keep things as they are
fi
fi (or better do it the other way around: explicitly naming the older ones for SYSTEMV as that list should be "static" – though then systemd would be used for all unknowns as well). Where |
A 2b option would be keep the current version of .spec as it is, and create a new one specific for systemd systems. But that means that you'll have to build two .deb packages as well. |
Which I'd rather avoid. Not everyone who's interested in Monitorix might be able to tell what it means (though one would think someone who configures it should know, some might be happy with the defaults already, or still be at "novice level). And even if, some might accidentally pick the wrong one. Addendum for 2a, as Again, as that tends to become error-prone, I'd prefer to go with variant 1. For all others, Monitorix is available in the "official repos" IIRC? So I could maybe name a dependency that's in base but not matched in newer distribution releases, like |
May I suggest not checking the version but just check if systemd is installed - for example if dir /var/run/systemd exists or "which systemctl" returns a result? |
Heh, why so easy when there are many funny complicated approaches 🙈 Right you are! if [ -d /var/run/systemd ]; then echo "SystemDemolized"; else echo "SystemPfeif"; fi
@mikaku That fine with you? If that directory is found, use the unit file – else use the init file? So:
Should be clean enough, would you agree? |
Sounds good. @DSmidge came with a simple idea indeed. 👍 |
Just let me know when you decided, and I'll try that with the next release (before pushing it out; maybe even giving you a copy of the DEB before deploying it – unless it's not needed because you implement the same 😉 |
…alled on systemd or SysV init systems #462
@IzzySoft, I've made the agreed changes in the Feel free to re-generate your .deb file and let me know if you see any problem. |
Hi. I have some problems with Monitorix. Server freezes when I do "service monitorix restart". Reboot works OK.
I removed a /dev/sdf from md1 raid from array and from monitorix.conf. Reload didn't helped. Reboot crashed the server.
The already happened previously and I recreated the /var/lib/monitorix directory.
Do you have any idea if this is a Monitorix problem or I have a faulty configuration. Maybe I shouldn't run Monitorix under Apache?
Config file is /etc/monitorix/conf.d/my.conf which is a link to other file. Permissions are OK.
Apache config:
# Monitorix
Alias /monitorix/ /var/lib/monitorix/www/
<Location /monitorix/>
Require all granted
ScriptAlias /monitorix-cgi/ /var/lib/monitorix/www/cgi/
<Location /monitorix-cgi/>
DirectoryIndex monitorix.cgi
Options ExecCGI
Require all granted
Related logs:
Feb 1 20:09:10 server systemd[1]: Stopping LSB: Start Monitorix daemon...
Feb 1 20:09:10 server monitorix[1200623]: ...done.
Feb 1 20:09:10 server systemd[1]: monitorix.service: Deactivated successfully.
Feb 1 20:09:10 server systemd[1]: monitorix.service: Unit process 1035 (/usr/bin/monito) remains running after unit stopped.
Feb 1 20:09:10 server systemd[1]: Stopped LSB: Start Monitorix daemon.
Feb 1 20:09:10 server systemd[1]: monitorix.service: Consumed 1h 15min 28.200s CPU time.
Feb 1 20:09:10 server systemd[1]: monitorix.service: Found left-over process 1035 (/usr/bin/monito) in control group while starting unit. Ignoring.
Feb 1 20:09:10 server systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Feb 1 20:09:10 server systemd[1]: monitorix.service: Found left-over process 1200630 (/usr/bin/monito) in control group while starting unit. Ignoring.
Feb 1 20:09:10 server systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Feb 1 20:09:10 server systemd[1]: Starting LSB: Start Monitorix daemon...
Feb 1 20:09:10 server monitorix[1200631]: ...done.
Feb 1 20:09:10 server systemd[1]: Started LSB: Start Monitorix daemon.
Feb 1 20:09:46 server mariadbd[1462]: 2024-02-01 20:09:46 1255 [Warning] Aborted connection 1255 to db: ...
Feb 1 20:09:46 server mariadbd[1462]: 2024-02-01 20:09:46 36949 [Warning] Aborted connection 36949 to db: ...
Feb 1 20:09:46 server mariadbd[1462]: 2024-02-01 20:09:46 1257 [Warning] Aborted connection 1257 to db: ...
Feb 1 20:09:46 server mariadbd[1462]: 2024-02-01 20:09:46 36948 [Warning] Aborted connection 36948 to db: ...
Feb 1 20:09:58 server mariadbd[1462]: 2024-02-01 20:09:58 1251 [Warning] Aborted connection 1251 to db: ...
Feb 1 20:10:04 server mariadbd[1462]: 2024-02-01 20:10:04 1268 [Warning] Aborted connection 1268 to db: ...
Feb 1 20:11:22 server systemd[1]: Received SIGINT.
Feb 1 20:11:22 server systemd[1]: Stopping Session 1030 of User sa...
Feb 1 20:11:22 server systemd[1]: Removed slice Slice /system/modprobe.
Feb 1 20:11:22 server systemd[1]: Stopped target Graphical Interface.
... more Stopped commands below
And monitorix screenshots:
The text was updated successfully, but these errors were encountered: