summaryrefslogtreecommitdiff
path: root/usr.sbin/rcctl
AgeCommit message (Collapse)Author
2015-01-01Drop redundant FUNCS_ONLY.Antoine Jacoutot
2014-12-30Rename a few functions name. Will help factorize some stuffs.Antoine Jacoutot
2014-12-30do not print an empty order in case pkg_scripts is undefinedRobert Nagy
ok ajacoutot@
2014-12-30add_flags() does not need any action argument.Antoine Jacoutot
Use the flags variable instead of hardcoding the output in preparation for further subcommands.
2014-12-29document ordering more explicitly;Ingo Schwarze
feedback and ok ajacoutot@ rpe@
2014-12-24Implement some kind ordering in the startup of package script daemons.Antoine Jacoutot
'rcctl order ...' will prepend the daemon(s) given as argument to the pkg_scripts line (it can be all daemons, some, or just one). Without argument, it'll display the current order. While here, drop a couple of examples from the man page to only leave the most interesting one. ok schwarze@ rpe@ (with tweaks) jasper@ robert@ sthen@
2014-12-23Consistency: put variables between curly braces.Antoine Jacoutot
No functional change intended.
2014-11-01Simplify.Antoine Jacoutot
with and ok schwarze@
2014-10-31Make default output matches status. Hackish but we are not allowed toAntoine Jacoutot
use svc_default_enabled_flags like any other function...
2014-10-31Useless use of sed(1).Antoine Jacoutot
ok swartze@
2014-10-27Ensure proper separation of grep's options and rcctl options thatRobert Peichaer
may end up in ${svc} by mistake. OK ajacoutot@
2014-10-15Add a new ls_rcscripts() function to properly get all rc.d(8) scriptsAntoine Jacoutot
ignoring irrelevant stuffs under /etc/rc.d. reworked based on a submission from Craig R. Skinner ok schwarze@
2014-10-13Carefully quote the flags argument such that leading blank charactersIngo Schwarze
are preserved in all situations; this is relevant such that for example 'rcctl enable identd flags " "' puts 'identd_flags=" "' into /etc/rc.conf.local and subsequent 'rcctl enable identd' without flags keeps it intact instead of stripping it down to 'identd_flags='. ok ajacoutot@
2014-10-13document the "default" subcommand more precisely;Ingo Schwarze
joint work with and OK by ajacoutot@
2014-10-11Fix a small bug in rcctl status <daemon>:Ingo Schwarze
If the daemon has default flags in its rc.d(8) script but its flags are explicitly set to =" " in rc.conf.local(8), the default flags were erroneously displayed. Show " " instead. ok ajacoutot@
2014-10-11Add a new "default" command to display the default flags and whether aAntoine Jacoutot
service is enabled or disabled by default. idea from Patrik Lundin discussed with and ok schwarze@
2014-10-10Actually use built-in print like rc.subr already does.Antoine Jacoutot
2014-10-10Use printf(1) to prevent '-e' in daemon_flags from being fed as anAntoine Jacoutot
argument to the built-in echo.
2014-10-10Allow passing flags without arguments for special variables.Antoine Jacoutot
initial request and patch from Patrik Lundin simpler patch from and ok schwartze@
2014-09-01Fix evil typo.Antoine Jacoutot
from wbyte via Bryan Steele
2014-08-31Add Ingo's copyright as per his request.Antoine Jacoutot
2014-08-31No need to update daemon_flags in the enviroment anymore since theAntoine Jacoutot
recent change to append_to_pkg_scripts().
2014-08-31Document that exit code 2 indicates a non-existent service.Antoine Jacoutot
2014-08-30When a service is not available, return ENOENT.Antoine Jacoutot
Previous to this commit it was not possible to know whether a service existed without parsing the output of 'rcctl status' which is very expensive. req. by armani@ ok robert@ schwarze@
2014-08-29Additional input validation:Ingo Schwarze
Error out on "rcctl enable daemon flags NO". Without this check, this "enable" command effectively disabled the daemon. "commit" ajacoutot@
2014-08-29Simplify append_to_pkg_scripts(), in particular avoid the expensiveIngo Schwarze
svc_is_enabled() and look at ${pkg_scripts} only, flags are not relevant to this function. "please commit" ajacoutot@
2014-08-29Document the fact that 'enable' can also be used to modify flags even ifAntoine Jacoutot
the daemon is already enabled.
2014-08-28Drop check and tweak comment.Antoine Jacoutot
with schwarze@
2014-08-28Simplify.Antoine Jacoutot
2014-08-28Consistency in conditionals; no functional change.Antoine Jacoutot
2014-08-27Disentangle svc_default_enabled_flags() and svc_get_flags().Ingo Schwarze
This saves three expensive function calls in svc_default_enabled_flags(), two to _rc_parse_conf() and one to svc_get_flags(). No functional change. Feedback and ok ajacoutot@.
2014-08-26Simplify the function add_flags().Ingo Schwarze
Do not validate input twice, scrap needless array, and avoid needless expensive function calls to svc_get_flags(), svc_default_enabled_flags(), _rc_parse_conf(), and resolve code duplication. No functional change. Feedback and OK ajacoutot@.
2014-08-25Base system special services have no flags, so move the test for themIngo Schwarze
up front in add_flags(). This avoids unnecessary work, avoids setting bogus variables, and reduces the risk of screwing up things when changing the code. No functional change right now. ok ajacoutot@
2014-08-25get rid of the tempfile in svc_default_enabled_flags();Ingo Schwarze
feedback and ok ajacoutot@
2014-08-25rc.d scripts are shell scripts and need to be sourced in svc_get_flags().Antoine Jacoutot
It's the only way to get daemon_flags in case it contains line continuation... We only need to do that for enable package scripts. original idea from Sebastien Marie discussed with, input from and ok schwarze@
2014-08-25For functions that take args, return immediately if no args is passed.Antoine Jacoutot
Add/drop missing/unused local variables. no functionnal change
2014-08-25Cope with some weird rc.conf.local file like "foobar" in pkg_scriptsAntoine Jacoutot
while "foobar_flags" is set to "NO"... Reparse deamon_flags at the end of add_flags() since they may have been modified by the function.
2014-08-25Simplify rm_from_pkg_scripts(); minus ten lines; no functional change;Ingo Schwarze
ok ajacoutot@. For non-trivial automated text editing in sh(1), thou shalt use sed(1).
2014-08-25Display usage on 2 lines.Antoine Jacoutot
reworked from an original diff by schwarze@
2014-08-24Delete the function svc_get_all().Ingo Schwarze
In svc_is_avail(), this simplifies the code by getting rid of the loop. When running "rcctl status", this allows to not run svc_is_special() - which spawns a grep - for each and every service, resulting in a 20% speedup. As a bonus, we get the special services listed at the end, where they are easier to see than mixed in with the daemons. ok ajacoutot@ jasper@
2014-08-24Whitelisting allowed services is safer and less confusing thanIngo Schwarze
blacklisting auxiliary variables, and it makes the coupling to rc.subr(8) less tight. Feedback and OK ajacoutot@.
2014-08-24Start all error messages with "rcctl: " such that it is clear whereIngo Schwarze
they come from. While here, there is no need to check the argument of needs_root() before displaying it, it is always provided. ok ajacoutot@ jasper@
2014-08-24Add a comment to unconfuse Ingo :-)Antoine Jacoutot
2014-08-24Drop obvious comments.Antoine Jacoutot
2014-08-24reduce indentation of main program by one tab, no functional changeIngo Schwarze
ok ajacoutot@
2014-08-24Fix args to needs_root() when using "disable" (broken in the v1.9Antoine Jacoutot
positional args cleanup commit). from Sebastien Marie
2014-08-24Since rcctl(8) can changes the position of such and such variable, sortAntoine Jacoutot
the file so that we always have a consistent output. ok schwarze@ jasper@
2014-08-24Make it possible to pass `-d' and `-f' to the rc.d(8) script.Antoine Jacoutot
man page bits from schwarze@ ok jasper@ schwarze@
2014-08-21add $OpenBSD$Jonathan Gray
2014-08-21Make "rcctl status" output match rc.conf(8) format.Antoine Jacoutot
ok jasper@