A general mechanism for specifying devfs(8) rules

From: Mike Makonnen (mtm_at_identd.net)
Date: 08/04/03

  • Next message: David Schultz: "Re: headsup: swap_pager.c"
    Date: Sun, 3 Aug 2003 20:18:45 -0400
    To: freebsd-arch@FreeBSD.Org
    
    
    

    Hello folks,

    While polishing up an enhanced jail script submitted by
    "Scot W. Hetzel" <hetzels@westbend.net> it became necessary
    to introduce mechanism to specify devfs(8) rules. The script
    needed to provide a default set of rules, but it also needed
    to accept rules specified by the user. So, after some testing
    and suggestions by Jens Rehsack <rehsack@liwing.de> I decided
    I might as well make it work for the general case also. Attached
    is a patch that should do just that. Similarly to rc.conf(5),
    there's a src/etc/defaults/devfs.rules file. But an user can
    include local rules by adding the file to a devfs_rulesets
    variable in rc.conf. The format of the file is simple. Essentially,
    it goes like this:

    [ruleset_name=#some_number]
    action
    action
    ...

    [another_ruleset_name=#some_other_number]
    action
    action
    ...

    To use a specific rule, you specify it by name in the
    devfs_system_ruleset variable in your rc.conf.

    I have tried to do two things with this patch:
    1. Remove, from the user's point of view, the necessity to
       know ruleset numbers. The ruleset numbers are used in only
       one place, devfs.rules. So, if you rearrange the ruleset
       numbers you don't need to change any rc.conf settings. Even
       in the rules file, if you change the number of a ruleset
       you don't have to change any rulesets that refer to it
       because they use the name instead.

    2. Keep the things that are different from the real devfs(8)
       command as few as possible. So, with one small exception
       (to allow you to use ruleset names instead of numbers) the
       action lines for each ruleset are passed directly to the
       devfs(8) command.

    Comments ?

    Cheers.

    -- 
    Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
    mtm@identd.net | D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9
    mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon!
    
    
    

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"



  • Next message: David Schultz: "Re: headsup: swap_pager.c"

    Relevant Pages

    • Re: jail_box_ip=""
      ... must specify a ruleset number ... Hey, I got a couple of hundred IPs, is there an easy way to add them ... You can include multi-line whitespace in the variables by using single ...
      (freebsd-questions)
    • Re: Did a makeworld now my jails wont start!! Uh oh..
      ... specify a ruleset number" but whenever I try to SSH into one of my ... jails I seem to have logged onto the main system. ...
      (freebsd-questions)
    • Calling ruleset 98
      ... What exactly is the format of the string which should be passed to the ... ruleset 98? ... I want to specify the mailer and the host explicitly to which one the ...
      (comp.mail.sendmail)