1

I'm looking for method or methods and automation tools to log the adjustments I make to a Linux machine.

Such adjustments would be:

  • Installation of new software/software components via apt-get, including forcing particular versions to be installed
  • Installation of Perl modules
  • Use of make install, make process to meet the goals of the above items
  • Changes to paths and environment variables
  • Just about any kind of change you can do to a Linux machine
  • Logging of the errors that may result in any of the steps above

I would use this technique of logging to:

  • enable the steps to be duplicated, to be repeatable on another Linux machine, for example if I am setting up the same applications for several machines
  • provide a basis for documenting the steps
  • help with providing an undo process, to undo the changes restoring the machine back to the state before the changes were made

Why do I think such a method or methods and tools is necessary?

  • Because we can often be under pressure, typing lots of commands one after the other to get something to build, then install, etc
  • Because there seems to be a lot of Linux-based software out there that doesn't quite work how the makers intended or instructions are incomplete, ambiguous. (It's getting better though, with sites like this and howtoforge.com)
  • Because Linux administrators, developers aren't so good at documenting what they did, or reluctant, or find it a boring task, regarding it as unimportant

Features I would be looking for would include:

  • Logging commands typed and the output
  • Logging resultant changes make to system
  • Perhaps a BeyondCompare style comparison tool to intelligently compare filesystem partition made before and after changes
therobyouknow
  • 471
  • 4
  • 8
  • 18
  • 1
    Presumably you've looked at syslog? – Chopper3 Dec 21 '09 at 10:43
  • I have looked at syslog and it appears to be a logging tool but quite clear on what it logs syslog.org is unfriendly for the uninitiated like me: no plain english explanation illustrated by how it can be applied. But that is just initial impressions. – therobyouknow Dec 21 '09 at 16:33
  • Thank you for the comment though, it may be useful in some circumstances, alongside or as a supplement to Puppet/Chef. – therobyouknow Dec 22 '09 at 10:06

3 Answers3

3

You have just described Configuration Management and tools such as Puppet or Chef.

The principle is that you write your configurations modularly in a domain-specific language. These modules can then be layered up in order to bring a host to a required complete or partial state and keep it there. They also form your documentation, since the DSL should be easy to read and re-use. When combined with Revision Control you have more granular control of changes. Most implementations include logging methods which can be expanded upon.

The only thing generally missing from your requirements is the ability to truly capture state and facilitate undo actions. CM can simplify this to some respect, by documenting changes and storing replaced files, but I'm not aware of any systems that will provide a snapshot-like rollback. You might be able to achieve that with virtualisation and backups though.

Dan Carley
  • 25,617
  • 5
  • 53
  • 70
  • These sound like what I need. However, even though they are open source, I'm concerned that they are "owned" by commercial companies. Am I right? My concerns are: what if the companies stop support and development and what if they change the terms and conditions of use? – therobyouknow Dec 21 '09 at 16:32
  • 2
    Puppet and Chef are both stand-alone, open source projects; they're not sponsored by a commercial entity like Red Hat, so they should keep going as long as there is a community to use them. Picking either tool shouldn't cause you any more risk than with any of the open source Linux tools you probably already use. – gareth_bowles Dec 21 '09 at 17:02
  • In that case I've made this the accepted answer 1) as it covers most, if not all of my question 2) you mentioned it here first and then others answered with the same so that reinforces the answer 3) You reassurance that it is standalone opensource. Thank you. – therobyouknow Dec 22 '09 at 10:05
2

For the "Logging commands typed and the output" part, you can use the command script.

SCRIPT(1)                 BSD General Commands Manual                SCRIPT(1)

NAME
     script — make typescript of terminal session

SYNOPSIS
     script [-a] [-c COMMAND] [-f] [-q] [-t] [file]

DESCRIPTION
     Script makes a typescript of everything printed on your terminal.  It is
     useful for students who need a hardcopy record of an interactive session
     as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).

     If the argument file is given, script saves all dialogue in file.  If no
     file name is given, the typescript is saved in the file typescript.

Really useful to document what you did.

sebthebert
  • 1,234
  • 8
  • 21
1

Rather than approaching it that way, why not simply make all your changes to your servers via a configuration management system like Puppet? That's how I manage my machines and this way I can be sure that all my machines in a load balanced cluster are identical.

rodjek
  • 3,327
  • 17
  • 14
  • Thanks I've accepted Puppet/Chef as the ultimate solution, meanwhile I'll use script command (mentioned above) while I get up-to-speed with Puppet/Chef. – therobyouknow Dec 22 '09 at 10:08