Restart services without rebooting server?
i run cPanel Security Advisor and get this warning:
how to restart them without reboot my server?
Detected 11 processes that are running outdated executables: 29474 29458 1942 27030 27036 27751 1 27802 28640 5208 28649
Reboot the server to ensure the system benefits from these updates.
[root@server~]# /usr/bin/needs-restarting
29474 : /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/3rdparty/attracta/scripts/daily_jobs.pl
29458 : /usr/sbin/CROND -n
27030 : /usr/sbin/CROND -n
27036 : /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/3rdparty/attracta/scripts/daily_jobs.pl
27751 : /usr/sbin/CROND -n
1 : /usr/lib/systemd/systemd --system --deserialize 21
27802 : /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/3rdparty/attracta/scripts/daily_jobs.pl
28640 : /usr/sbin/CROND -n
5208 : top -c
28649 : /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/3rdparty/attracta/scripts/daily_jobs.pl
how to restart them without reboot my server?
-
Hello @lambov, You can restart the individual services in most cases. For example, you can restart the crond service with the following command: /scripts/restartsrv_crond
As far as the "systemd" service, you can reexecute the systemd manager with the following command:systemctl daemon-reexec
There's a third-party URL discussing the need to restart systemd at: top that's listed after running the ps command. Note that a full reboot of the system is required in some cases. You can use the --reboothint flag if you're using CentOS 7 or higher to see if that's the case on your system. EX:/usr/bin/needs-restarting --reboothint
Thank you.0 -
If I follow that external link, it tells me that lsof -p1 | grep deleted : systemd will tell me if systemd really needs to be restarted. For systems running KernelCare, it would be nice if WHM could determine that a restart is not actually required, and then not put up a big warning box that conveys the wrong information. 0 -
If I follow that external link, it tells me that lsof -p1 | grep deleted : systemd will tell me if systemd really needs to be restarted. For systems running KernelCare, it would be nice if WHM could determine that a restart is not actually required, and then not put up a big warning box that conveys the wrong information.
Hello @LoadFactor, While a reboot may not be required in every case, it's generally the safest and quickest approach to ensuring the server is not running outdated processes or executables. The alternative discussed on the StackOverflow link involves an advanced level of system administration knowledge and manual intervention. That said, I encourage you to open a feature request if you'd like to request a change or improvement to Security Advisor: Search Results (8) - "Tag: Security Advisor" | cPanel & WHM Feature Requests Thank you.0 -
@cPanelMichael Can you elaborate on the command you talked about earlier: /usr/bin/needs-restarting --reboothint
I tried that on my Cloudlinux 6 box with cPanel 74.0.8 and got the following results:# /usr/bin/needs-restarting --reboothint Usage: needs-restarting: Report a list of process ids of programs that started running before they or some component they use were updated. needs-restarting: error: no such option: --reboothint
and a -h only lists:# /usr/bin/needs-restarting -h Usage: needs-restarting: Report a list of process ids of programs that started running before they or some component they use were updated. Options: -h, --help show this help message and exit -u, --useronly show processes for my userid only
Is the --reboothint from a future cPanel version or a different OS ?0 -
Is the --reboothint from a future cPanel version or a different OS ?
Hello @rpvw, The needs-restarting binary is part of the operating system and not included with cPanel & WHM. The "--reboothint" flag is only supported on CentOS 7. I've edited my earlier post to reflect that information. Thank you.0
Please sign in to leave a comment.
Comments
5 comments