Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Restart services without rebooting server?

Discussion in 'General Discussion' started by lambov, Apr 18, 2018.

  1. lambov

    lambov Member

    Joined:
    Oct 9, 2016
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Earth
    cPanel Access Level:
    Root Administrator
    i run cPanel Security Advisor and get this warning:
    Code:
    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.
    Code:
    [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?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @lambov,

    You can restart the individual services in most cases. For example, you can restart the crond service with the following command:

    Code:
    /scripts/restartsrv_crond
    As far as the "systemd" service, you can reexecute the systemd manager with the following command:

    Code:
    systemctl daemon-reexec
    There's a third-party URL discussing the need to restart systemd at:

    Can I restart systemd without rebooting?

    As for the remaining processes (perl and top), those processes can be killed manually if they are still running. EX:

    Code:
    ps aux|grep top
    kill -9 $PID
    Replace "$PID" with the process ID for 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:

    Code:
    /usr/bin/needs-restarting --reboothint
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 cPanelMichael, Apr 19, 2018
    Last edited: Sep 19, 2018
    linux4me2 likes this.
  3. LoadFactor

    LoadFactor Active Member

    Joined:
    Jul 12, 2013
    Messages:
    31
    Likes Received:
    4
    Trophy Points:
    83
    cPanel Access Level:
    Root Administrator
    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.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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:

    Submit A Feature Request

    You can also see list of existing feature requests associated with Security Advisor at:

    Search Results (8) - "Tag: Security Advisor" | cPanel & WHM Feature Requests

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    911
    Likes Received:
    351
    Trophy Points:
    113
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    Can you elaborate on the command you talked about earlier:
    I tried that on my Cloudlinux 6 box with cPanel 74.0.8 and got the following results:
    Code:
    # /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:
    Code:
    # /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 ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice