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

service.status currently reports an error on FreeBSD if the service isn't running #23435

Closed
JaseFace opened this issue May 7, 2015 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@JaseFace
Copy link
Contributor

JaseFace commented May 7, 2015

In FreeBSD, service onestatus currently returns 1 if either the service is not running, or it simply doesn't exist. This seems to be proper handling of the service not existing case, but Salt should not treat a down status as an error:

# salt-call service.status moo
[ERROR   ] Command '/usr/sbin/service moo onestatus' failed with return code: 1
[ERROR   ] output: moo does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d)
local:
    False
# salt-call service.status inetd
[ERROR   ] Command '/usr/sbin/service inetd onestatus' failed with return code: 1
[ERROR   ] output: inetd is not running.
local:
    False

We possibly need to parse the return on a 1, and in the case of 'is not running', squelch the error?

The simple state that is triggering this is service.dead:

freebsd_inetd:
  service.dead:
    - name: inetd
@JaseFace
Copy link
Contributor Author

JaseFace commented May 7, 2015

Looking a Debuntu, it seems to be in the same boat. I guess this is just a low priority bug that might need some extra logic in all service modules.

[INFO    ] Executing command ['service', 'mpt-statusd', 'status'] in directory '/root'
[ERROR   ] Command ['service', 'mpt-statusd', 'status'] failed with return code: 3
[ERROR   ] output:  * mpt-statusd is not running
local:
    False

@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels May 11, 2015
@jfindlay jfindlay added this to the Approved milestone May 11, 2015
@jfindlay
Copy link
Contributor

@JaseFace, thanks for the report. Return codes are traditionally inconsistent across distros and commands and are always a challenge to interpret correctly.

@abednarik
Copy link
Contributor

Hi @JaseFace

I made a Pr in order help fixing this. Check this if you have time.

Thanks

@terminalmage
Copy link
Contributor

The spurious logging is removed by #33294.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

4 participants