Skip to content
This repository
Browse code

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...
commit 47903a1f4bc53d00ca7bdb72faf3c6d9cf202947 1 parent 2208023
authored November 11, 2009
10  Makefile
@@ -19,10 +19,10 @@
19 19
 
20 20
 DESTDIR  ?= 
21 21
 PREFIX   ?= /usr
22  
-ETCDIR   ?= /etc
  22
+ETCDIR   ?= /etc/spine-mgmt
23 23
 BINDIR   ?= $(PREFIX)/bin
24  
-LIBDIR   ?= $(PREFIX)/lib/spine
25  
-STATEDIR ?= /var/spine
  24
+LIBDIR   ?= $(PREFIX)/lib/spine-mgmt
  25
+STATEDIR ?= /var/spine-mgmt
26 26
 BALLDIR  ?= $(STATEDIR)/configballs
27 27
 SUBDIRS   = $(ETCDIR) $(STATEDIR) $(BALLDIR) $(BINDIR) $(LIBDIR)
28 28
 MKDIR    ?= /bin/mkdir
@@ -35,13 +35,13 @@ mkdirs:
35 35
 		$(MKDIR) -p -m 0755 $(DESTDIR)$$dir; \
36 36
 	done
37 37
 
38  
-install_config: spine-config.conf scripts/cramfs-publisher.conf
  38
+install_config: spine-mgmt.conf scripts/cramfs-publisher.conf
39 39
 	for I in $^; do \
40 40
 		$(INSTALL) -m 0644 $$I $(DESTDIR)$(ETCDIR); \
41 41
 	done
42 42
 
43 43
 
44  
-install_scripts: spine-config quick_template ui scripts/spine-cramfs-publish.py
  44
+install_scripts: spine-mgmt quick_template ui scripts/spine-cramfs-publish.py
45 45
 	for I in $^; do \
46 46
 		$(INSTALL) -m 0755 $$I $(DESTDIR)$(BINDIR); \
47 47
 	done
2  docs/README-EXAMPLE_CONFIG
@@ -91,7 +91,7 @@ tree before attempting to use it. The FS permissions on all overlay
91 91
 directories are directly translated to the permissions on the resulting file.
92 92
 Once you've done that, spine can be used like this:
93 93
 
94  
-  spine --dryrun --croot /path/to/example_spine_config --host <hostname>
  94
+  spine-mgmt --dryrun --croot /path/to/example_spine_config --host <hostname>
95 95
 
96 96
 Note that the hostname MUST resolve using DNS.
97 97
 
6  lib/Spine/Data.pm
@@ -138,13 +138,13 @@ sub populate
138 138
     }
139 139
 
140 140
     # Some truly basic stuff first.
141  
-    $self->{c_label} = 'spine_core';
  141
+    $self->{c_label} = 'spine-mgmt core';
142 142
     $self->{c_start_time} = time();
143 143
     $self->{c_ppid} = $$;
144 144
 
145 145
     # FIXME  Should these be moved to Spine::Plugin::Overlay?
146  
-    $self->{c_tmpdir} = "/tmp/spine." . $self->{c_ppid};
147  
-    $self->{c_tmplink} = "/tmp/spine.lastrun";
  146
+    $self->{c_tmpdir} = "/tmp/spine-mgmt." . $self->{c_ppid};
  147
+    $self->{c_tmplink} = "/tmp/spine-mgmt.lastrun";
148 148
 
149 149
     # Retrieve "internal" config values nesessary for bootstrapping of
150 150
     # discovery and therefore parsing of the tree.
2  quick_template
@@ -23,4 +23,4 @@ if [ "$1" = "--markers" ]; then
23 23
     MARKERS='--template-markers'
24 24
 fi
25 25
 
26  
-/bin/env spine-config --template-quick ${MARKERS} $@
  26
+/bin/env spine-mgmt --template-quick ${MARKERS} $@
92  spine-config → spine-mgmt
@@ -24,7 +24,7 @@ our $VERSION = sprintf("%d", q$Revision$ =~ /(\d+)/);
24 24
 
25 25
 use strict;
26 26
 
27  
-use lib q(/usr/lib/spine);
  27
+use lib q(/usr/lib/spine-mgmt);
28 28
 
29 29
 my $perl_ver = sprintf "%vd", $^V;
30 30
 my $error_count = 0;
@@ -47,18 +47,19 @@ use Sys::Syslog;
47 47
 use sigtrap 'handler' => \&ignore_signal, 'normal-signals';
48 48
 
49 49
 use constant NODEFILE => '/etc/nodename';
50  
-use constant LOCKFILE => '/var/run/spine.lock';
51  
-use constant DEFAULT_CONFIGFILE => '/etc/spine-config.conf';
52  
-use constant DEFAULT_CONFIGFILE_FALLBACK => '/etc/spine.conf';
  50
+use constant LOCKFILE => '/var/run/spine-mgmt.lock';
  51
+use constant DEFAULT_CONFIGFILE => '/etc/spine-mgmt/spine-mgmt.conf';
  52
+use constant DEFAULT_CONFIGFILE_FALLBACK => ('/etc/spine-config.conf',\
  53
+                                             '/etc/spine.conf');
53 54
 use constant SPINE_PHASES => qw(PREPARE EMIT APPLY CLEAN);
54 55
 
55 56
 use constant DEFAULT_CONFIG => {
56 57
         spine => {
57  
-            StateDir => '/var/spine',
  58
+            StateDir => '/var/spine-mgmt',
58 59
             ConfigSource => 'ISO9660',
59 60
             Profile => 'StandardPlugins',
60 61
             Parser => 'pureTT',
61  
-            SyslogIdent => 'spine',
  62
+            SyslogIdent => 'spine-mgmt',
62 63
             SyslogFacility => 'local3',
63 64
             SyslogOptions => 'ndelay,pid',
64 65
         },
@@ -75,7 +76,7 @@ use constant DEFAULT_CONFIG => {
75 76
 
76 77
         ISO9660 => {
77 78
             URL => 'http://repository/cgi-bin/rcrb.pl',
78  
-            Destination => '/var/spine/configballs',
  79
+            Destination => '/var/spine-mgmt/configballs',
79 80
             Timeout => 5
80 81
         },
81 82
 
@@ -128,49 +129,46 @@ if ($DEBUG)
128 129
 #
129 130
 Getopt::Long::Configure('pass_through');
130 131
 
131  
-my $cfile = DEFAULT_CONFIGFILE;
132  
-if (not -f $cfile)
133  
-{
134  
-    $cfile = DEFAULT_CONFIGFILE_FALLBACK;
135  
-}
136  
-
137 132
 my $profile = undef;
  133
+my $conf_file = undef;
138 134
 my @actions = ();
139 135
 
140  
-GetOptions('config-file=s' => \$cfile,
  136
+GetOptions('config-file=s' => \$conf_file,
141 137
             'action|plugin=s@' => \@actions,
142 138
             'actiongroup|profile=s' => \$profile);
143 139
 
144 140
 Getopt::Long::Configure('no_pass_through');
145 141
 
  142
+my @cfiles = (DEFAULT_CONFIGFILE, DEFAULT_CONFIGFILE_FALLBACK);
146 143
 
147  
-# Parse the config file
148  
-$CONFIG = new Spine::ConfigFile(Filename => $cfile, Type => 'Ini');
149  
-$CONFIG->{spine}->{Profile} = $profile if defined($profile);
150  
-
151  
-if (not defined($CONFIG))
  144
+if (defined($conf_file))
152 145
 {
153  
-    if ($cfile ne DEFAULT_CONFIGFILE)
154  
-    {
155  
-	print STDERR $Spine::ConfigFile::ERROR;
156  
-	goto failure;
157  
-    }
  146
+    my @cfiles = ($conf_file);
  147
+}
158 148
 
159  
-    if (-f $cfile and (not -r $cfile))
  149
+foreach my $file (@cfiles)
  150
+{
  151
+    if (-f $file)
160 152
     {
161  
-	print STDERR "Default config file $cfile exists but isn't readable.\n";
162  
-	goto failure;
  153
+        print "spine-mgmt: Using config file at $file\n";
  154
+        $CONFIG = new Spine::ConfigFile(Filename => $file, Type => 'Ini');
  155
+        if (not defined($CONFIG))
  156
+        {
  157
+            print STDERR $Spine::ConfigFile::ERROR;
  158
+            goto failure;
  159
+        }
  160
+        last;
163 161
     }
  162
+}
164 163
 
165  
-    if (not -f DEFAULT_CONFIGFILE)
166  
-    {
167  
-	print STDERR "No config file found at default $cfile. "
168  
-            . "Using hardcoded defaults.\n";
169  
-
170  
-        $CONFIG = DEFAULT_CONFIG;
171  
-    }
  164
+if (not defined($CONFIG))
  165
+{
  166
+    print STDERR "spine-mgmt: No config file found. Using hardcoded defaults.\n";
  167
+    $CONFIG = DEFAULT_CONFIG;
172 168
 }
173 169
 
  170
+$CONFIG->{spine}->{Profile} = $profile if defined($profile);
  171
+
174 172
 
175 173
 # Take care of our PluginPath if provided
176 174
 if (defined($CONFIG->{spine}->{PluginPath}))
@@ -375,7 +373,7 @@ if (not defined($release))  # There was an error
375 373
 }
376 374
 
377 375
 
378  
-print 'spine_core: Using configuration: ', $source->source_info(), "\n";
  376
+print 'spine-mgmt core: Using configuration: ', $source->source_info(), "\n";
379 377
 
380 378
 
381 379
 # Determine the hostname.
@@ -406,11 +404,11 @@ else
406 404
 
407 405
 
408 406
 # Announce what we're doing
409  
-print 'spine: starting Spine v' . $VERSION . ' -- configuration release ',
  407
+print 'spine-mgmt: starting Spine v' . $VERSION . ' -- configuration release ',
410 408
       $source->release(), "\n";
411  
-print "spine: initializing data for $hostname\n";
  409
+print "spine-mgmt: initializing data for $hostname\n";
412 410
 if ( ${%{$registry->get_options()}->{dryrun}} ) {
413  
-    print "spine: running in dryrun mode\n";
  411
+    print "spine-mgmt: running in dryrun mode\n";
414 412
     syslog("info", "running in dryrun mode");
415 413
 }
416 414
 
@@ -425,7 +423,7 @@ my $c = Spine::Data->new(hostname    => $hostname,
425 423
 #
426 424
 # rtilder  Tue Jun 27 12:23:39 PDT 2006
427 425
 if (not defined($c)) {
428  
-    print STDERR 'spine initialization: Errors encountered parsing '
  426
+    print STDERR 'spine-mgmt initialization: Errors encountered parsing '
429 427
         . "data tree.\n";
430 428
     goto failure;
431 429
 }
@@ -434,7 +432,7 @@ if (not defined($c)) {
434 432
 # have had a critical parsing error.
435 433
 if ($c->getval('c_failure'))
436 434
 {
437  
-    print STDERR 'spine initialization: Errors encountered parsing '
  435
+    print STDERR 'spine-mgmt initialization: Errors encountered parsing '
438 436
         . "data tree.\n";
439 437
     goto failure;
440 438
 }
@@ -536,7 +534,7 @@ if ($SAVE_STATE)
536 534
 if ( defined $c->{c_lame_keys} )
537 535
 {
538 536
     my $size = keys %{$c->{c_lame_keys}};
539  
-    print "spine: Encountered $size keys with lame TT syntax!\n";
  537
+    print "spine-mgmt: Encountered $size keys with lame TT syntax!\n";
540 538
 }
541 539
 
542 540
 finished:
@@ -883,7 +881,7 @@ sub usage
883 881
 {
884 882
     print STDERR (<<EOF);
885 883
 Spine v$VERSION -- Configuration management system.
886  
-Usage: spine [options]
  884
+Usage: spine-mgmt [options]
887 885
 
888 886
     --action <action>	
889 887
 			Run the specified action(s). Actions are defined
@@ -899,7 +897,7 @@ Usage: spine [options]
899 897
     --croot <directory>
900 898
 			Location of the configuration hierarchy.
901 899
 			By default, this path will be relative
902  
-			to the spine executable in config/.
  900
+			to the spine-mgmt executable in config/.
903 901
 
904 902
     --autofqdn
905 903
 			Attempt to determine the FQDN. Use this
@@ -939,7 +937,7 @@ Usage: spine [options]
939 937
 
940 938
     --config-file <file>
941 939
                         The configuration file to use for this script.
942  
-                        The default is /etc/spine.conf.
  940
+                        The default is /etc/spine-mgmt/spine-mgmt.conf.
943 941
 
944 942
     --config-source <configuration source type>
945 943
                         The type of configuration source to use.  Defined by
@@ -967,9 +965,9 @@ Usage: spine [options]
967 965
 
968 966
 Examples:
969 967
 
970  
-    spine --profile apply_auth
971  
-    spine --action apply_overlay --action process_templates
972  
-    spine --croot /tmp/testconfig --hostname some.host.name.tld
  968
+    spine-mgmt --profile apply_auth
  969
+    spine-mgmt --action apply_overlay --action process_templates
  970
+    spine-mgmt --croot /tmp/testconfig --hostname some.host.name.tld
973 971
 
974 972
 Notes:
975 973
 
4  spine-config.conf → spine-mgmt.conf
... ...
@@ -1,6 +1,6 @@
1 1
 [spine]
2 2
 ConfigSource = ISO9660
3  
-StateDir = /var/spine
  3
+StateDir = /var/spine-mgmt
4 4
 Profile = StandardPlugins
5 5
 Parser = pureTT
6 6
 SyslogIdent = spine
@@ -9,7 +9,7 @@ SyslogOptions = ndelay,pid
9 9
 
10 10
 [ISO9660]
11 11
 URL = http://repository/cgi-bin/rrcb.pl
12  
-Destination = /var/spine/configballs
  12
+Destination = /var/spine-mgmt/configballs
13 13
 Timeout = 5
14 14
 
15 15
 [DefaultPlugins]
2  ui
@@ -23,7 +23,7 @@
23 23
 
24 24
 use strict;
25 25
 
26  
-use lib qw(/usr/lib/spine);
  26
+use lib qw(/usr/lib/spine-mgmt);
27 27
 
28 28
 use Getopt::Long;
29 29
 use Spine::Util;

0 notes on commit 47903a1

Please sign in to comment.
Something went wrong with that request. Please try again.