Commit Graph

11 Commits (2acfbf016d8626df445839caf522debc393f0d31)

Author SHA1 Message Date
Patrik Lundin 2acfbf016d Handle string returned by 'default' correctly.
We need to handle the string returned by 'default' in the same way we handle
the string returned by 'status' since the resulting flags are compared later.
10 years ago
Patrik Lundin eea4d06848 Fix typo: Replace "N0" with "NO". 10 years ago
Patrik Lundin f9d9c1b6d7 Multiple fixes for OpenBSD rcctl handling.
* Use the newly added 'default' argument to know if the default flags are set
  or not.
* Handle that 'status' may either return flags or YES/NO.
* Centralize flag handling logic.
* Set action variable after check if we need to keep going.

Big thanks to @ajacoutot for implementing the rcctl 'default' argument.
10 years ago
Patrik Lundin e463400412 Simplify self.arguments logic.
Strange logic pointed out by @jarmani, thanks!
10 years ago
Patrik Lundin 924cf20cf8 Depend more on rcctl if it is present.
* Make the module support enable/disable of special services like pf via rcctl.
  Idea and method from @jarmani.
* Make the module handle when the user supplied 'arguments' variable does not
  match the current flags in rc.conf.local.
* Update description now that the code tries to use rcctl for everything if it
  is available.
10 years ago
Patrik Lundin 5f37624eb4 Tweak error checking for "enabled" code.
Based on input from @jarmani:
* A return value of 2 now means a service does not exist. Instead of
  trying to handle the different meanings of rc after running "status",
  just look at stderr to know if something failed.
* Skip looking at stdout to make the code cleaner. Any errors should
  turn up on stderr.
10 years ago
Patrik Lundin c6dd88c1d1 Fail if "rcctl status" writes to stderr. 10 years ago
Patrik Lundin 1a8cdb5e3e Check rc and print error message if any.
It is probably good to use stdout before printing a generic error
message as well.
10 years ago
Patrik Lundin c46e030100 Make "enabled" code aware of --check mode. 10 years ago
Jonathan Armani 1b97390765 Add enable / disable of services for OpenBSD if rcctl is present 10 years ago
Michael DeHaan c8e1a2077e file extensions! 10 years ago