Bug ID: 207811
Summary: service -e doesn't show all enabled services
Product: Base System
Severity: Affects Some People
Assignee: [hidden email] Reporter: [hidden email] CC: [hidden email] CC: [hidden email]
I have seen this few times before on another machines. This time I came to file
a PR for it.
I have isc-dhcp41-server-4.1.e_10,2 installed and enabled in rc.conf but
service -e doesn't show it:
--- Comment #2 from Jason Unovitch <[hidden email]> ---
Add isc-dhcp maintainer to CC.
This is because the isc-dhcp script uses parameter expansion to strip the isc-
off of $name. See below from a 'sh -x /usr/sbin/service -e'. Note that 'eval
name' fails because $name is still defined as whatever service was before it.
We ran into the same issue with tomcat 8 and 8.5. The attached patch fixes the
issue in service itself by querying the service with `run_rc_script … enabled`
to figure out if it's enabled or not.
I think the way name is defined in tomcat 8 should not be considered an error
as it's from what I understand done to make it easier to have multiple
instances of tomcat running. Which is done by linking/copying the original rc
script and defining the new variables in rc.conf using the name of the new file
instead of the old.
I realised the original patch had an issue with rcvar being empty. Here is an
updated patch which works around this by defining a default dummy rcvar incase
it's not set in the rc script. Although hacky, it does seem to work.