Bug 194347 - Return an error when rc service is not enabled
Summary: Return an error when rc service is not enabled
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-14 11:14 UTC by roy
Modified: 2014-10-14 11:14 UTC (History)
0 users

See Also:


Attachments
Return an error if service is not enabled. (497 bytes, patch)
2014-10-14 11:14 UTC, roy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description roy 2014-10-14 11:14:22 UTC
Created attachment 148290 [details]
Return an error if service is not enabled.

Currently the rc service returns success when testing any function and it's not enabled.

# in rc.conf
ntpd_enable=NO  # or unset

# in a sample script
if /etc/rc.d/ntpd status >/dev/null 2>&1; then
   # ntpd is running but we changed it's config, lets restart it for the new one
   /etc/rc.d/ntpd restart
fi