Skip to content
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

fix: add a delay between starting Netdata and checking pids #12420

Merged

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Mar 16, 2022

Summary

The delay is needed on slow servers, that is what I get on my DO droplet (Basic plan):

Stopping all netdata threads
[/home/ilyam/netdata]# stop_all_netdata
 OK

Starting netdata using command 'systemctl start netdata'
[/home/ilyam/netdata]# systemctl start netdata
 OK

Ooops! it seems netdata is not started.
Attempting another netdata start using command 'systemctl start netdata'
[/home/ilyam/netdata]# systemctl start netdata
 OK

Hm... it seems netdata is still not started.
Netdata service still not started, attempting another forced restart by running '/opt/netdata/usr/sbin/netdata '
[/home/ilyam/netdata]# stop_all_netdata
 OK

[/home/ilyam/netdata]# /opt/netdata/usr/sbin/netdata
 OK

 OK  netdata started!

The reason is:

  • systemctl start netdata returns as soon as "netdata.service" cgroup created.
  • Netdata is not started by this moment (ExecStart directive hasn't been executed (or at least completed)).

The end result is:

  • I got running Netdata.
  • but it is not controlled by systemd (systemd netdata unit is failed, I have to kill -9 netdata process).

I didn't find a way to delay systemctl start <service> returning.

Test Plan

Install Netdata, ensure Netdata is started by systemd and not manually by the script.

installer log after the patch
 --- Restarting netdata instance ---

Stopping all netdata threads
[/home/ilyam/src/nd_ilyam8]# stop_all_netdata
 OK

Starting netdata using command 'systemctl start netdata'
[/home/ilyam/src/nd_ilyam8]# systemctl start netdata
 OK

 OK  netdata started!

[/home/ilyam/src/nd_ilyam8]# chmod 0644 /opt/netdata/etc/netdata/netdata.conf
 OK
Additional Information

@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Mar 16, 2022
@ilyam8 ilyam8 marked this pull request as ready for review March 16, 2022 09:00
@ilyam8 ilyam8 merged commit 0750b26 into netdata:master Mar 16, 2022
@ilyam8 ilyam8 deleted the add_delay_to_check_nd_pids_after_start branch March 16, 2022 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packaging Packaging and operating systems support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants