OpenBSD Journal

Heads up: rcctl(8) the rc.conf.local management tool landing in base soon

Contributed by pitrh on from the was that by by remote control dept.

Antoine Jacoutot (ajacoutot@) has just committed committed a tool for managing rc.conf.local(8), in order to make it simpler for automated management systems such as Puppet or Ansible to interface with the operating system configuration:

CVSROOT:	/cvs
Module name:	src
Changes by:	ajacoutot@cvs.openbsd.org	2014/08/19 08:08:20

Added files:
	usr.sbin/rcctl : Makefile rcctl.8 rcctl.sh 

Log message:
Introduce rcctl(8), a simple utility for maintaining rc.conf.local(8).

# rcctl
usage: rcctl enable|disable|status|action [service [flags [...]]]

Lots of man page improvement from the usual suspects (jmc@ and schwarze@)
not hooked up yet but committing now so work can continue in-tree
agreed by several

(Comments are closed)


Comments
  1. By Michael W Lucas (agshekeloh) mwlucas@michaelwlucas.com on http://www.michaelwlucas.com

    Hurrah!

    I've seen all kinds of goofy errors with these management systems. I don't want ansible/puppet/whatever screwing up my carefully configured OpenBSD boxes... that's my job.

    Comments
    1. By Ray Percival (sng) on http://undeadly.org/cgi?action=search&sort=time&query=sng

      Automation from the Latin roots auto meaning self and mate meaning screw.

      > Hurrah!
      >
      > I've seen all kinds of goofy errors with these management systems. I don't want ansible/puppet/whatever screwing up my carefully configured OpenBSD boxes... that's my job.

      Comments
      1. By Anonymous Coward (2001:981:aaf3:1:3dde:b41d:a8c8:f208) on

        > Automation from the Latin roots auto meaning self and mate meaning screw.

        Greek, not Latin

  2. By Anonymous Coward (91.65.157.11) on

    So basicaly this will replace the manual edition of rc.conf.local?
    I install a new system, tell rcctl what services should run and it creates me such a file wich I then could copy to other mashines?

    So the advantage is that I don't need to lookup if some stuff has NAME_flags="" or NAME=yes/no ?

    Comments
    1. By Antoine Jacoutot (ajacoutot) on http://www.bsdfrog.org/

      > So basicaly this will replace the manual edition of rc.conf.local?

      No. You can use whichever you prefer.
      Keep editing rc.conf.local manually, use rcctl or use both. We do not enforce anything.

      > I install a new system, tell rcctl what services should run and it creates me such a file wich I then could copy to other mashines?
      >
      > So the advantage is that I don't need to lookup if some stuff has NAME_flags="" or NAME=yes/no ?

      Something like that.
      To know if a service is enabled or not, you don't need to go read the defaults in rc.conf and the overrides in rc.conf.local.
      You can just do:
      rcctl status foobar

      Let's say you want to enable ntpd on your box and set the time immediately at startup. You have now 2 options:
      - edit /etc/rc.conf.local manually and add:
      ntpd_flags=-s
      - use rcctl:
      rcctl enable ntpd flags -s

      The presence of an existing rc.conf.local file does not matter, it will be created if it's not there.
      The tool is especially interesting for config management systems which need to maintain service states (enabled, started, ...).

      Comments
      1. By Anonymous Coward (2601:6:51c0:e1:e834:aa3e:863d:9884) on

        > > So basicaly this will replace the manual edition of rc.conf.local?
        >
        > No. You can use whichever you prefer.
        > Keep editing rc.conf.local manually, use rcctl or use both. We do not enforce anything.
        > [snip]
        > The tool is especially interesting for config management systems which need to maintain service states (enabled, started, ...).


        Good stuff. Many thanks for doing this!

  3. By thomasw_ (108.172.49.178) thomas.wildeman@gmail.com on

    assuming that rcctl will require root/sudo to run and that I can still manaually edit rc.conf.local, I can foresee more efficient setups with this utility. so, thanks heaps for the work on this devs!

    Comments
    1. By rjc (rjc) on

      > assuming that rcctl will require root/sudo to run and that I can still manaually edit rc.conf.local, I can foresee more efficient setups with this utility. so, thanks heaps for the work on this devs!

      Well, 'enable/disable' obviously do but I doubt the same will apply to 'status'.

    2. By phessler (phessler) on http://www.openbsdfoundation.org/donations.html

      > assuming that rcctl will require root/sudo to run and that I can still manaually edit rc.conf.local, I can foresee more efficient setups with this utility. so, thanks heaps for the work on this devs!

      how would rcctl require root to run, but editing rc.conf.local not?

      Comments
      1. By Anonymous Coward (thomasw_) on http://www.flickr.com/photos/thomasw_/

        > > assuming that rcctl will require root/sudo to run and that I can still manaually edit rc.conf.local, I can foresee more efficient setups with this utility. so, thanks heaps for the work on this devs!
        >
        > how would rcctl require root to run, but editing rc.conf.local not?

        sorry for the noise.

        i used poor phrasing; instead of "... and that I can ...," I would've been more clear to write "... just as I can do while still being able to manually edit ..."

        Comments
        1. By phessler (phessler) on http://www.openbsdfoundation.org/donations.html

          > > > assuming that rcctl will require root/sudo to run and that I can still manaually edit rc.conf.local, I can foresee more efficient setups with this utility. so, thanks heaps for the work on this devs!
          > >
          > > how would rcctl require root to run, but editing rc.conf.local not?
          >
          > sorry for the noise.
          >
          > i used poor phrasing; instead of "... and that I can ...," I would've been more clear to write "... just as I can do while still being able to manually edit ..."

          yes you can.

  4. By Anonymous Coward (62.159.86.18) on

    Does this work for pkg_scripts as well?

    Comments
    1. By Antoine Jacoutot (ajacoutot) on http://www.bsdfrog.org/

      > Does this work for pkg_scripts as well?

      Yes it does.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]