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

systemctl disable output is masked and failure is not handled #2107

Open
jsoref opened this issue Feb 23, 2023 · 2 comments
Open

systemctl disable output is masked and failure is not handled #2107

jsoref opened this issue Feb 23, 2023 · 2 comments

Comments

@jsoref
Copy link
Contributor

jsoref commented Feb 23, 2023

I just tried to remove wazuh from a system and the apt/dpkg process failed miserably.

It took too much effort to debug, the error was from this line:

systemctl disable wazuh-api.service > /dev/null 2>&1

At the very least, if the output and error are going to be ignored, the error code should as well.

For debugging, I changed the code...

-systemctl disable wazuh-api.service > /dev/null 2>&1 
+systemctl disable wazuh-api.service || echo echo disable failed -- oh well

Here's the run w/ that change (under sh -x):

+ systemctl disable wazuh-agent
Synchronizing state of wazuh-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable wazuh-agent
Failed to disable unit: Too many levels of symbolic links
+ echo disable failed -- oh well
disable failed -- oh well
@DFolchA
Copy link
Contributor

DFolchA commented Mar 15, 2023

Hello @jsoref

Thank you for reporting this, could you tell us which version of Wazuh were you using?

That command should only be executed during an upgrade when the old version is 3.x, so it should not apply during an uninstall.

@jsoref
Copy link
Contributor Author

jsoref commented Mar 15, 2023

It's kinda irrelevant. Your code is broken and in certain cases apt will use the latest version.

I'm not sure offhand, I turned off the computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants