Re: Run one-time startup script

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



On Wed, Sep 25, 2013 at 3:58 AM, Kai Schaetzl <maillists@xxxxxxxxxxxxx> wrote:

> First, I omitted to explicitely state that these are web servers. There is
> no dhcp, only one or, in a few cases, a few IP static IP addresses. Mostly
> Centos 5. Changing the data is *not* the problem. As already said this
> will mostly be done by replacing config files (cp -a, not mv, this assures
> it can be done even more than once without a problem, replacement
> operations in files always ask for trouble if something non-standard
> happens, not to mention one has to code this - it's easier just to provide
> the correct new files), and by reading in a sql command that replaces an
> IP address in some tables.
>
> The big question is when and how to do this.

Why don't you just do it (except maybe the sql thing) before the
shutdown?   That is, instead of putting a script in place and changing
something else to schedule a later run, just run it and be done.   You
probably already have a way to control them via ssh from a single
location anyway - just run a script there that does them all at once
close to shutdown time.  The config file changes won't take effect
until a reboot anyway.   The sql change is more of a special case
though.   Unless you know all of the code involved, it's likely that
some other components are going to read and cache the old values and
not update after your change.  I'd try to shut that box down last and
make the change at the very end.  Or make sure it starts first and has
the new values before anything else can connect - otherwise you may
have to restart the other components.   If your sql command sets a
field value where the old value matches your old addresses and there
is no overlap in new/old ranges then it wouldn't hurt to run multiple
times so you shouldn't have to be careful about that part..

-- 
   Les Mikesell
     lesmikesell@xxxxxxxxx
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux