Permalink
Browse files

Subject: Rename spine to spine-mgmt

Author: Chet Burges

Trac: Refs #96

Rename the spine binary to spine-mgmt.
Rename most references of spine to spine-mgmt.
Move config files to /etc/spine-mgmt/

Note: Yet another commit message form. Hopefully the
subject at the top will make the messages look cleaner
in RSS readers.

Signed-off-by: Chet Burgess <cfb@liquidreality.org>
  • Loading branch information...
1 parent 2208023 commit 47903a1f4bc53d00ca7bdb72faf3c6d9cf202947 cfb committed Nov 11, 2009
Showing with 58 additions and 60 deletions.
  1. +5 −5 Makefile
  2. +1 −1 docs/README-EXAMPLE_CONFIG
  3. +3 −3 lib/Spine/Data.pm
  4. +1 −1 quick_template
  5. +45 −47 spine-config → spine-mgmt
  6. +2 −2 spine-config.conf → spine-mgmt.conf
  7. +1 −1 ui
View
10 Makefile
@@ -19,10 +19,10 @@
DESTDIR ?=
PREFIX ?= /usr
-ETCDIR ?= /etc
+ETCDIR ?= /etc/spine-mgmt
BINDIR ?= $(PREFIX)/bin
-LIBDIR ?= $(PREFIX)/lib/spine
-STATEDIR ?= /var/spine
+LIBDIR ?= $(PREFIX)/lib/spine-mgmt
+STATEDIR ?= /var/spine-mgmt
BALLDIR ?= $(STATEDIR)/configballs
SUBDIRS = $(ETCDIR) $(STATEDIR) $(BALLDIR) $(BINDIR) $(LIBDIR)
MKDIR ?= /bin/mkdir
@@ -35,13 +35,13 @@ mkdirs:
$(MKDIR) -p -m 0755 $(DESTDIR)$$dir; \
done
-install_config: spine-config.conf scripts/cramfs-publisher.conf
+install_config: spine-mgmt.conf scripts/cramfs-publisher.conf
for I in $^; do \
$(INSTALL) -m 0644 $$I $(DESTDIR)$(ETCDIR); \
done
-install_scripts: spine-config quick_template ui scripts/spine-cramfs-publish.py
+install_scripts: spine-mgmt quick_template ui scripts/spine-cramfs-publish.py
for I in $^; do \
$(INSTALL) -m 0755 $$I $(DESTDIR)$(BINDIR); \
done
View
2 docs/README-EXAMPLE_CONFIG
@@ -91,7 +91,7 @@ tree before attempting to use it. The FS permissions on all overlay
directories are directly translated to the permissions on the resulting file.
Once you've done that, spine can be used like this:
- spine --dryrun --croot /path/to/example_spine_config --host <hostname>
+ spine-mgmt --dryrun --croot /path/to/example_spine_config --host <hostname>
Note that the hostname MUST resolve using DNS.
View
6 lib/Spine/Data.pm
@@ -138,13 +138,13 @@ sub populate
}
# Some truly basic stuff first.
- $self->{c_label} = 'spine_core';
+ $self->{c_label} = 'spine-mgmt core';
$self->{c_start_time} = time();
$self->{c_ppid} = $$;
# FIXME Should these be moved to Spine::Plugin::Overlay?
- $self->{c_tmpdir} = "/tmp/spine." . $self->{c_ppid};
- $self->{c_tmplink} = "/tmp/spine.lastrun";
+ $self->{c_tmpdir} = "/tmp/spine-mgmt." . $self->{c_ppid};
+ $self->{c_tmplink} = "/tmp/spine-mgmt.lastrun";
# Retrieve "internal" config values nesessary for bootstrapping of
# discovery and therefore parsing of the tree.
View
2 quick_template
@@ -23,4 +23,4 @@ if [ "$1" = "--markers" ]; then
MARKERS='--template-markers'
fi
-/bin/env spine-config --template-quick ${MARKERS} $@
+/bin/env spine-mgmt --template-quick ${MARKERS} $@
View
92 spine-config → spine-mgmt
@@ -24,7 +24,7 @@ our $VERSION = sprintf("%d", q$Revision$ =~ /(\d+)/);
use strict;
-use lib q(/usr/lib/spine);
+use lib q(/usr/lib/spine-mgmt);
my $perl_ver = sprintf "%vd", $^V;
my $error_count = 0;
@@ -47,18 +47,19 @@ use Sys::Syslog;
use sigtrap 'handler' => \&ignore_signal, 'normal-signals';
use constant NODEFILE => '/etc/nodename';
-use constant LOCKFILE => '/var/run/spine.lock';
-use constant DEFAULT_CONFIGFILE => '/etc/spine-config.conf';
-use constant DEFAULT_CONFIGFILE_FALLBACK => '/etc/spine.conf';
+use constant LOCKFILE => '/var/run/spine-mgmt.lock';
+use constant DEFAULT_CONFIGFILE => '/etc/spine-mgmt/spine-mgmt.conf';
+use constant DEFAULT_CONFIGFILE_FALLBACK => ('/etc/spine-config.conf',\
+ '/etc/spine.conf');
use constant SPINE_PHASES => qw(PREPARE EMIT APPLY CLEAN);
use constant DEFAULT_CONFIG => {
spine => {
- StateDir => '/var/spine',
+ StateDir => '/var/spine-mgmt',
ConfigSource => 'ISO9660',
Profile => 'StandardPlugins',
Parser => 'pureTT',
- SyslogIdent => 'spine',
+ SyslogIdent => 'spine-mgmt',
SyslogFacility => 'local3',
SyslogOptions => 'ndelay,pid',
},
@@ -75,7 +76,7 @@ use constant DEFAULT_CONFIG => {
ISO9660 => {
URL => 'http://repository/cgi-bin/rcrb.pl',
- Destination => '/var/spine/configballs',
+ Destination => '/var/spine-mgmt/configballs',
Timeout => 5
},
@@ -128,49 +129,46 @@ if ($DEBUG)
#
Getopt::Long::Configure('pass_through');
-my $cfile = DEFAULT_CONFIGFILE;
-if (not -f $cfile)
-{
- $cfile = DEFAULT_CONFIGFILE_FALLBACK;
-}
-
my $profile = undef;
+my $conf_file = undef;
my @actions = ();
-GetOptions('config-file=s' => \$cfile,
+GetOptions('config-file=s' => \$conf_file,
'action|plugin=s@' => \@actions,
'actiongroup|profile=s' => \$profile);
Getopt::Long::Configure('no_pass_through');
+my @cfiles = (DEFAULT_CONFIGFILE, DEFAULT_CONFIGFILE_FALLBACK);
-# Parse the config file
-$CONFIG = new Spine::ConfigFile(Filename => $cfile, Type => 'Ini');
-$CONFIG->{spine}->{Profile} = $profile if defined($profile);
-
-if (not defined($CONFIG))
+if (defined($conf_file))
{
- if ($cfile ne DEFAULT_CONFIGFILE)
- {
- print STDERR $Spine::ConfigFile::ERROR;
- goto failure;
- }
+ my @cfiles = ($conf_file);
+}
- if (-f $cfile and (not -r $cfile))
+foreach my $file (@cfiles)
+{
+ if (-f $file)
{
- print STDERR "Default config file $cfile exists but isn't readable.\n";
- goto failure;
+ print "spine-mgmt: Using config file at $file\n";
+ $CONFIG = new Spine::ConfigFile(Filename => $file, Type => 'Ini');
+ if (not defined($CONFIG))
+ {
+ print STDERR $Spine::ConfigFile::ERROR;
+ goto failure;
+ }
+ last;
}
+}
- if (not -f DEFAULT_CONFIGFILE)
- {
- print STDERR "No config file found at default $cfile. "
- . "Using hardcoded defaults.\n";
-
- $CONFIG = DEFAULT_CONFIG;
- }
+if (not defined($CONFIG))
+{
+ print STDERR "spine-mgmt: No config file found. Using hardcoded defaults.\n";
+ $CONFIG = DEFAULT_CONFIG;
}
+$CONFIG->{spine}->{Profile} = $profile if defined($profile);
+
# Take care of our PluginPath if provided
if (defined($CONFIG->{spine}->{PluginPath}))
@@ -375,7 +373,7 @@ if (not defined($release)) # There was an error
}
-print 'spine_core: Using configuration: ', $source->source_info(), "\n";
+print 'spine-mgmt core: Using configuration: ', $source->source_info(), "\n";
# Determine the hostname.
@@ -406,11 +404,11 @@ else
# Announce what we're doing
-print 'spine: starting Spine v' . $VERSION . ' -- configuration release ',
+print 'spine-mgmt: starting Spine v' . $VERSION . ' -- configuration release ',
$source->release(), "\n";
-print "spine: initializing data for $hostname\n";
+print "spine-mgmt: initializing data for $hostname\n";
if ( ${%{$registry->get_options()}->{dryrun}} ) {
- print "spine: running in dryrun mode\n";
+ print "spine-mgmt: running in dryrun mode\n";
syslog("info", "running in dryrun mode");
}
@@ -425,7 +423,7 @@ my $c = Spine::Data->new(hostname => $hostname,
#
# rtilder Tue Jun 27 12:23:39 PDT 2006
if (not defined($c)) {
- print STDERR 'spine initialization: Errors encountered parsing '
+ print STDERR 'spine-mgmt initialization: Errors encountered parsing '
. "data tree.\n";
goto failure;
}
@@ -434,7 +432,7 @@ if (not defined($c)) {
# have had a critical parsing error.
if ($c->getval('c_failure'))
{
- print STDERR 'spine initialization: Errors encountered parsing '
+ print STDERR 'spine-mgmt initialization: Errors encountered parsing '
. "data tree.\n";
goto failure;
}
@@ -536,7 +534,7 @@ if ($SAVE_STATE)
if ( defined $c->{c_lame_keys} )
{
my $size = keys %{$c->{c_lame_keys}};
- print "spine: Encountered $size keys with lame TT syntax!\n";
+ print "spine-mgmt: Encountered $size keys with lame TT syntax!\n";
}
finished:
@@ -883,7 +881,7 @@ sub usage
{
print STDERR (<<EOF);
Spine v$VERSION -- Configuration management system.
-Usage: spine [options]
+Usage: spine-mgmt [options]
--action <action>
Run the specified action(s). Actions are defined
@@ -899,7 +897,7 @@ Usage: spine [options]
--croot <directory>
Location of the configuration hierarchy.
By default, this path will be relative
- to the spine executable in config/.
+ to the spine-mgmt executable in config/.
--autofqdn
Attempt to determine the FQDN. Use this
@@ -939,7 +937,7 @@ Usage: spine [options]
--config-file <file>
The configuration file to use for this script.
- The default is /etc/spine.conf.
+ The default is /etc/spine-mgmt/spine-mgmt.conf.
--config-source <configuration source type>
The type of configuration source to use. Defined by
@@ -967,9 +965,9 @@ Usage: spine [options]
Examples:
- spine --profile apply_auth
- spine --action apply_overlay --action process_templates
- spine --croot /tmp/testconfig --hostname some.host.name.tld
+ spine-mgmt --profile apply_auth
+ spine-mgmt --action apply_overlay --action process_templates
+ spine-mgmt --croot /tmp/testconfig --hostname some.host.name.tld
Notes:
View
4 spine-config.conf → spine-mgmt.conf
@@ -1,6 +1,6 @@
[spine]
ConfigSource = ISO9660
-StateDir = /var/spine
+StateDir = /var/spine-mgmt
Profile = StandardPlugins
Parser = pureTT
SyslogIdent = spine
@@ -9,7 +9,7 @@ SyslogOptions = ndelay,pid
[ISO9660]
URL = http://repository/cgi-bin/rrcb.pl
-Destination = /var/spine/configballs
+Destination = /var/spine-mgmt/configballs
Timeout = 5
[DefaultPlugins]
View
2 ui
@@ -23,7 +23,7 @@
use strict;
-use lib qw(/usr/lib/spine);
+use lib qw(/usr/lib/spine-mgmt);
use Getopt::Long;
use Spine::Util;

0 comments on commit 47903a1

Please sign in to comment.