Skip to main content

Restart services without rebooting server?

Comments

5 comments

  • cPanelMichael
    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
  • LoadFactor
    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
  • cPanelMichael
    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
  • rpvw
    @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
  • cPanelMichael
    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.