Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rc.d script to load before secure level change



Zoran Kolic <zkolic%sbb.rs@localhost> writes:

> #!/bin/sh
> #
>
> # PROVIDE: modload
> # REQUIRE: pf
> # BEFORE: SECURELEVEL
>
> name="modload"
> rcvar=$name
> command="/sbin/modload pf"
>
> load_rc_config $name
> run_rc_command "$1"
>
>
> For sure, I might be wrong. At least, BEFORE is not what
> is needed to be, but I cannot define the value name.
> To run the script, it should include "modload=YES" in
> /etc/rc.conf.
> Does it look like what we were talking about last few days?
> Best regards

That looks like a good start.  A few comments:

  I would have thought you don't need to PROVIDE the script name.  But
  it seems every rc.d script does.

  REQUIRE: pf looks backward.  You want this to run before
  /etc/rc.d/pf.  So say "BEFORE: pf".

  With BEFORE: securelevel, that might be enough, if pf is forced to be
  after SECURELEVEL anyway.  Keep in mind that upper case names are
  usually just used for before/after and don't have a script.   I don't
  see that, but I do see /etc/rc.d/securelevel, so that should be lower case.

  You can run "rcorder *" in /etc/rc.d  to see what order is chosen.
  That can prove that the dependencies are wrong, but can't prove they
  are right :-)

  It makes sense to have a script to do what you want, but really the
  modload script should take a variable of a list of modules and load
  those.  So probably you wouldn't have command= but point it at a shell
  function and write a for loop.

Attachment: pgp8RjUMN0uDo.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index