Re: reload rc.conf during boot process

From: Markie (mark.cullen_at_dsl.pipex.com)
Date: 09/21/04

  • Next message: Chiang Seng Chang: "Re: need help: install jdk14"
    To: "Giorgos Keramidas" <keramida@ceid.upatras.gr>
    Date: Tue, 21 Sep 2004 14:40:44 +0100
    
    

    ----- Original Message -----
    From: "Giorgos Keramidas" <keramida@ceid.upatras.gr>
    To: "Markie" <mark.cullen@dsl.pipex.com>
    Cc: <freebsd-questions@freebsd.org>
    Sent: Tuesday, September 21, 2004 2:24 PM
    Subject: Re: reload rc.conf during boot process

    | On 2004-09-21 14:18, Markie <mark.cullen@dsl.pipex.com> wrote:
    | > "Giorgos Keramidas" <keramida@ceid.upatras.gr> wrote:
    | > | > After running my program in the rc.d mount script I then did a
    | > | >
    | > | > . /etc/rc.conf
    | > | >
    | > | > but rc.conf doesn't get reloaded.
    | > |
    | > | The /etc/rc script is a ``driver script'' that loads rc.conf before
    teh
    | > | mount script has a chance to run. Even if you reload rc.conf in the
    | > | mountd script this cannot affect the parent process that runs
    /etc/rc.
    | >
    | > Oh I think I see what you're saying, it's kind of like variable scope,
    | > right? When I do . /etc/rc.conf in mountcritlocal that's loading the
    file,
    | > but only for that script? It's not actually replacing the variables at
    all,
    | > right?
    |
    | They're environment variables and that's how environment variables work
    in
    | UNIX. Environment variables can be changed in a process and this will
    affect
    | all the processes spawned off by the one with the changed environment but
    it
    | won't affect processes higher up the hierarchy.
    |
    | The `/etc/rc' script starts `/etc/rc.d/mountd' after setting some of
    these
    | variables (by running . /etc/rc.conf as usual). The mountd process
    inherits
    | the environment of /etc/rc and can make changes to its environment as
    much as
    | it wants. The changes don't affect the parent process (the /etc/rc
    | invocation).
    |

    That's basically what I was trying to say :-) I didn't know environment
    variables worked like that though, thanks for the info!

    | > I saw load_rc_config 'XXX' in early.sh or something, just a minute ago!
    | > Does the XXX do anything?
    |
    | Not much. It's just a placeholder to shuttup the checks near the
    beginning of
    | `load_rc_config'. Passing an invalid `command name' to load_rc_config
    lets us
    | load /etc/rc.conf and any other config file listed in "$source_rc_confs"
    | without having to re-invent load_rc_config every time.
    |

    Alright, fair play!

    | > I don't actually have rc.conf.d either, as far as I can tell?
    |
    | This shouldn't be a problem. Don't worry about it.
    |
    | > My idea was so I could try out FreeBSD on my laptop and keep it usable
    on
    | > the University network, [...]
    |
    | Yeah, I figured it was something of this sort :)
    |

    :-) it also gives me something to try and learn. It was good fun actually
    hacking up my first, possibly semi-useful, small little program in C! Now I
    know a little bit about how the RC scripts work too! It's pretty amazing
    what shell script programming can do!

    I was just looking at that diff you attached. I think I understand it near
    enough, but just before the esac is that like a default: style part? So if
    nothing matches, i.e if the script isn't called selectcf, then it'll just
    run the script and not reload rc.conf? Wouldn't I need a run_rc_script
    before the unset _rc_conf_loaded, to actually run my selectcf script? :-)

    | - Giorgos
    |

    Thanks for the super quick reply!

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


  • Next message: Chiang Seng Chang: "Re: need help: install jdk14"

    Relevant Pages

    • Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
      ... (If you are running it in a webserver probably not). ... are the same environment variables ... Try running the script with the following code inserted near the ... Environment variables should be set prior to running the script. ...
      (perl.dbi.users)
    • RE: local admin account password
      ... environment, yes we may have these, but we still use the same methods. ... With regards to the script, this script is actually run from a secured ... The local passwords are secured both in a secure password ...
      (Focus-Microsoft)
    • Re: Help with system seeming to return too soon...
      ... >>install script. ... > a new process, sets the environment variables in that process, then ... I can on the command line) that I could get around this problem. ...
      (comp.lang.perl.misc)
    • (reposted) Question about CTRL-C handling in scripts
      ... I have a 'wrapper' script that sets up some environment variables and ... then executes another script, which then eventually runs a Fortran ... Then it requires a second <Ctrl-C> to exit this looping and return to ...
      (comp.unix.shell)
    • Re: Script for your enjoyment
      ... Another environment specific aspect. ... I do not maintain any databases ... The script should do that for you. ... isn't anyone checking if a domain group exists before they add it". ...
      (microsoft.public.scripting.wsh)