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

Avoid generating defunct process when starting Suricata #6366

Merged
merged 1 commit into from
May 27, 2024

Conversation

hongliangl
Copy link
Contributor

When antrea-agent starts Suricata instance with the following command:

suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/

The method Run() of exec.Cmd should be used instead of Start() to avoid generating a zombie process. The above command will exit after starting the process of Suricata instance in the background, so using Run() ensures that the command's resources are properly released and no defunct process remains.

When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
@hongliangl hongliangl requested a review from tnqn May 23, 2024 08:54
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnqn
Copy link
Member

tnqn commented May 23, 2024

/test-all

@tnqn tnqn added the action/release-note Indicates a PR that should be included in release notes. label May 23, 2024
@antoninbas
Copy link
Contributor

Should we backport?

@hongliangl
Copy link
Contributor Author

hongliangl commented May 24, 2024

Should we backport?

I think we should backport it.

@antoninbas antoninbas added the action/backport Indicates a PR that requires backports. label May 24, 2024
@hongliangl
Copy link
Contributor Author

/test-latest-all

1 similar comment
@hongliangl
Copy link
Contributor Author

/test-latest-all

@hongliangl
Copy link
Contributor Author

/test-latest-e2e
/test-latest-networkpolicy

@tnqn
Copy link
Member

tnqn commented May 27, 2024

/skip-all

@tnqn tnqn merged commit dbc856e into antrea-io:main May 27, 2024
55 of 60 checks passed
@hongliangl hongliangl deleted the 20240522-avoid-zombie-process branch May 28, 2024 02:06
hongliangl added a commit to hongliangl/antrea that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
hongliangl added a commit to hongliangl/antrea that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
hongliangl added a commit to hongliangl/antrea that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
tnqn pushed a commit that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
tnqn pushed a commit that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
tnqn pushed a commit that referenced this pull request May 28, 2024
When antrea-agent starts Suricata instance with the following command:

```
suricata -c /etc/suricata/suricata.yaml --af-packet -D -l /var/log/antrea/networkpolicy/l7engine/
```

The method `Run()` of `exec.Cmd` should be used instead of `Start()`
to avoid generating a zombie process. The above command will exit after starting
the process of Suricata instance in the background, so using `Run()` ensures that
the command's resources are properly released and no defunct process remains.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/backport Indicates a PR that requires backports. action/release-note Indicates a PR that should be included in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants