<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.orcaware.com/svn/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Martin+von+Gagern</id>
	<title>SubversionWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.orcaware.com/svn/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Martin+von+Gagern"/>
	<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/wiki/Special:Contributions/Martin_von_Gagern"/>
	<updated>2026-04-20T08:40:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=User_talk:TkeXwy&amp;diff=1632</id>
		<title>User talk:TkeXwy</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=User_talk:TkeXwy&amp;diff=1632"/>
		<updated>2007-07-15T08:58:34Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: /* Reverted edit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Reverted edit =&lt;br /&gt;
I&#039;ve been informed of [http://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;amp;diff=0&amp;amp;oldid=1619 your edit] to a page I wrote. The modification is almost certainly wrong, and deleting large parts of the page don&#039;t seem a minor modification. I could not see any indication why you did perform this edit. I just undid your edit, but if there was a point to it that I missed, please clarify the situation so we will find an acceptable solution. -- [[User:Martin von Gagern|Martin von Gagern]] 01:58, 15 July 2007 (PDT)&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1631</id>
		<title>System Configurations</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1631"/>
		<updated>2007-07-15T08:56:24Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Undo revision 1628 by Special:Contributions/TkeXwy (User talk:TkeXwy)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about &#039;&#039;&#039;how to&#039;&#039;&#039; manage configuration files (like &amp;lt;tt&amp;gt;/etc/*&amp;lt;/tt&amp;gt;) on your machine(s) using subversion.&lt;br /&gt;
&lt;br /&gt;
= Simple case =&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start off simple.&lt;br /&gt;
I assume you are root, as you are the one modifying the configuration files.&lt;br /&gt;
You first create a repository:&lt;br /&gt;
 svnadmin create /svn/configs&lt;br /&gt;
&lt;br /&gt;
Then you can make your root directory a working copy of this (so far empty) repository:&lt;br /&gt;
 svn checkout file:///svn/configs /&lt;br /&gt;
&lt;br /&gt;
Now you can start adding things you want to keep under revision control.&lt;br /&gt;
When adding directories, make sure to use the &amp;lt;tt&amp;gt;-N&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--non-recursive&amp;lt;/tt&amp;gt;) flag&lt;br /&gt;
to add only the directory itself and not all its contents.&lt;br /&gt;
And add directories before any files therein, although you may add both in the same command.&lt;br /&gt;
 svn add -N /etc /etc/fstab&lt;br /&gt;
&lt;br /&gt;
Now we want to have a look at what we modified so far.&lt;br /&gt;
A simple &amp;lt;tt&amp;gt;svn stat&amp;lt;/tt&amp;gt; will tell you all the things that are not under revision control so far.&lt;br /&gt;
When working with configuration files where you are not interested in many of them this is usually not what you want.&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--quiet&amp;lt;/tt&amp;gt;) flag suppresses those unmanaged files.&lt;br /&gt;
 svn stat -q /&lt;br /&gt;
&lt;br /&gt;
Now we are ready to commit our configurations to the repository.&lt;br /&gt;
It is usually a good idea to add and commit files &#039;&#039;before&#039;&#039; you modify them for the first time.&lt;br /&gt;
This way you can always compare any revision of the file to its &amp;quot;virgin&amp;quot; form supplied by your distribution.&lt;br /&gt;
And always write informative messages so you can later figure out not only what was changed but also why you changed it.&lt;br /&gt;
Remember to set &amp;lt;tt&amp;gt;EDITOR&amp;lt;/tt&amp;gt; for the root account as well if you do not supply the comment from the command line.&lt;br /&gt;
 svn commit / -m &amp;quot;vanilla files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You may want to have a list of all the files under version control.&lt;br /&gt;
Luckily you can combine the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; flag with &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--verbose&amp;lt;/tt&amp;gt;) to get just that:&lt;br /&gt;
 svn stat -qv /&lt;br /&gt;
&lt;br /&gt;
The basic work cycle probably is like this:&lt;br /&gt;
# if you modify file for the first time:&lt;br /&gt;
## add all parent dirs and the file itself&lt;br /&gt;
## commit&lt;br /&gt;
# edit the file&lt;br /&gt;
# check your modification works as expected, otherwise &amp;lt;tt&amp;gt;revert&amp;lt;/tt&amp;gt;&lt;br /&gt;
# list all modifications&lt;br /&gt;
# commit modifications, including message about the reason for this change&lt;br /&gt;
&lt;br /&gt;
= Basic concepts for multiple administrators &#039;&#039;or&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Maybe you are not the only one administrating the machine.&lt;br /&gt;
Assume there are several people who can become root and tweak the config files.&lt;br /&gt;
You would then want to know who changed what.&lt;br /&gt;
If you are accessing the repository using the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme you can simply provide&lt;br /&gt;
&amp;lt;tt&amp;gt;--username &amp;lt;/tt&amp;gt;&#039;&#039;yourName&#039;&#039; to provide this name for the record.&lt;br /&gt;
It does not even have to correspond to an existing system account.&lt;br /&gt;
 svn --username john commit /&lt;br /&gt;
&lt;br /&gt;
Maybe you decide to manage the configuration files for several machines in a single repository.&lt;br /&gt;
For the moment I&#039;ll consider the machines rather independent from one another,&lt;br /&gt;
so that you manage them in completely distinct trees of your repository.&lt;br /&gt;
Having them in the same repository still helps when diffing them,&lt;br /&gt;
applying changesets from one machine to another and so on,&lt;br /&gt;
so it&#039;s preferable to rather have subtrees in a single repository than different repositories.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s create a directory for a single machine in the above repository.&lt;br /&gt;
Note that we create dir directly in the repository, not in any checked out working copy.&lt;br /&gt;
 svn mkdir file:///svn/configs/macchina&lt;br /&gt;
&lt;br /&gt;
If you start off like this, you can simply check out the empty directory to the root directory of your machine,&lt;br /&gt;
instead of checking out the repository root as described above.&lt;br /&gt;
In case you started like described above and only later thought about adding other machines,&lt;br /&gt;
you&#039;ll need to move your existing contents to the new location:&lt;br /&gt;
 svn move file:///svn/configs/etc file:///svn/configs/macchina/etc&lt;br /&gt;
 svn switch file:///svn/configs/macchina /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure&#039;&#039;&#039; to first move the contents in the repository and only then switch your working copy,&lt;br /&gt;
because otherwise you might switch to an empty tree and all your versioned files would be deleted.&lt;br /&gt;
&lt;br /&gt;
You can then create additinal directories for other machines and check them out to their root directory.&lt;br /&gt;
Let&#039;s suppose you are working on a machine called &amp;lt;tt&amp;gt;maschine&amp;lt;/tt&amp;gt;. You could do the following:&lt;br /&gt;
 svn mkdir ssh+svn://root@macchina/svn/configs/maschine&lt;br /&gt;
 svn checkout ssh+svn://root@macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
= Advanced tricks for multiple administrators &#039;&#039;and&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Note that the trick for logging the user by passing &amp;lt;tt&amp;gt;--username&amp;lt;/tt&amp;gt;&lt;br /&gt;
to each command only works reasonably well with the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme.&lt;br /&gt;
It won&#039;t work with ssh access to another machine.&lt;br /&gt;
And it is easy enough to forget to provide your name.&lt;br /&gt;
We can solve all this and more by (ab)using the svn facility for defining tunnel applications.&lt;br /&gt;
&lt;br /&gt;
On every machine where you want to manage the configuration using svn,&lt;br /&gt;
first create the following file named &amp;lt;tt&amp;gt;/usr/local/bin/svn+sysadmin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Taken from http://www.orcaware.com/svn/wiki/System_Configurations&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   SYSADMIN=$(&lt;br /&gt;
     read -p &amp;quot;Your (non-root) login name: &amp;quot; NAME &amp;lt;/dev/tty &amp;gt;/dev/tty &amp;amp;&amp;amp; \&lt;br /&gt;
     echo &amp;quot;$NAME&amp;quot;&lt;br /&gt;
   )&lt;br /&gt;
 fi&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   echo &amp;quot;You need to give your name!&amp;quot; &amp;gt;/dev/tty&lt;br /&gt;
   exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 exec /usr/bin/ssh -l sysadmin-svn &amp;quot;$@&amp;quot; --tunnel-user=&amp;quot;${SYSADMIN}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Make it executable:&lt;br /&gt;
 chmod a+x /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
Register it in the &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[tunnels]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; section of your &amp;lt;tt&amp;gt;~/.subversion/config&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 [tunnels]&lt;br /&gt;
 sysadmin = /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
On the machine where the reporitory is, create a new user named &amp;lt;tt&amp;gt;sysadmin-svn&amp;lt;/tt&amp;gt;&lt;br /&gt;
and make it owner of the repository:&lt;br /&gt;
 chown -R sysadmin-svn /svn/configs&lt;br /&gt;
&lt;br /&gt;
To allow access to the repository, it is probably most convenient to create&lt;br /&gt;
a ssh public key for root on each machine (using &amp;lt;tt&amp;gt;ssh-keygen&amp;lt;/tt&amp;gt;).&lt;br /&gt;
I would consider it safe enough to not use a passphrase,&lt;br /&gt;
as this key only protects access to the repository and&lt;br /&gt;
if someone unauthorized managed to become root you are in trouble anyway.&lt;br /&gt;
You can then register all those keys in &amp;lt;tt&amp;gt;~sysadmin-svn/.ssh/authorized_keys&amp;lt;/tt&amp;gt;&lt;br /&gt;
on the machine with the repository to allow them all access to that account.&lt;br /&gt;
&lt;br /&gt;
Now you can move your machine config to this new scheme:&lt;br /&gt;
 svn switch --relocate ssh+svn://root@macchina/svn/configs/maschine ssh+sysadmin://macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Take care&#039;&#039;&#039; not to combine a &amp;lt;tt&amp;gt;switch --relocate&amp;lt;/tt&amp;gt; (to change scheme)&lt;br /&gt;
and a simple &amp;lt;tt&amp;gt;switch&amp;lt;/tt&amp;gt; (to change repository subtree) into a single step,&lt;br /&gt;
as I could imagine there would be trouble if you did so.&lt;br /&gt;
&lt;br /&gt;
Because you changed ownership of the repository,&lt;br /&gt;
it is probably easiest to access the repository through the &amp;lt;tt&amp;gt;ssh+sysadmin://&amp;lt;/tt&amp;gt; scheme&lt;br /&gt;
even on the machine where the repository lies.&lt;br /&gt;
This way you get the same behaviour no matter what machine you are on.&lt;br /&gt;
&lt;br /&gt;
Now whenever you access the configuration file repository,&lt;br /&gt;
you will asked your login name unless you set the &amp;lt;tt&amp;gt;SYSADMIN&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
Some commands like checkout make multiple connections,&lt;br /&gt;
so you&#039;ll have to provide your name multiple times.&lt;br /&gt;
&lt;br /&gt;
= Making use of the information =&lt;br /&gt;
&lt;br /&gt;
So what can you do now your files are under revision control?&lt;br /&gt;
&lt;br /&gt;
Suppose you are looking at some configuration file and want to know why some setting is the way it is.&lt;br /&gt;
You&#039;d [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.blame.html svn blame]&lt;br /&gt;
the file authors to see who edited it (that&#039;s what the user name logging is for)&lt;br /&gt;
and in which revision it was last modified.&lt;br /&gt;
You can then use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.log.html svn log]&lt;br /&gt;
to have a look at the message of that revision to get a clue why it was modified.&lt;br /&gt;
You can use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.cat.html svn cat]&lt;br /&gt;
or [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html svn diff]&lt;br /&gt;
to have a look at its previous setting.&lt;br /&gt;
And of course you can do [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.revert.html svn revert]&lt;br /&gt;
to undo changes you have not yet comitted and&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.merge.html svn merge]&lt;br /&gt;
to undo changes already comitted to the repository.&lt;br /&gt;
&lt;br /&gt;
= Sharing between machines =&lt;br /&gt;
&lt;br /&gt;
Above we were assuming completely independently configured machines.&lt;br /&gt;
&lt;br /&gt;
The opposite, completely identical machines, is almost as easy.&lt;br /&gt;
You remove any existing local config files and then check out a new copy of the tree.&lt;br /&gt;
You can then propagate configuration changes by comitting them on one machine and updating on all the others.&lt;br /&gt;
Whenever you put a file under revision control that existed on the machines before&lt;br /&gt;
you&#039;ll have to remove them before updating, which can be somewhat annoying.&lt;br /&gt;
I don&#039;t know any nice solution for this yet.&lt;br /&gt;
&lt;br /&gt;
How about mixed situations where some files are the same, but some others are not?&lt;br /&gt;
I would think it best to have two trees, one shared and one independent, checked out on each machine.&lt;br /&gt;
Of course only one of them can be the root.&lt;br /&gt;
Usually I&#039;d make this the independent tree unless you have very few differences.&lt;br /&gt;
You can then add symlinks from one tree to the other to get each configuration file from the correct tree.&lt;br /&gt;
&lt;br /&gt;
In case you made the independent tree your main working copy, you can graft the common tree using&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html svn:externals].&lt;br /&gt;
This way you model the tree composition in the repository as well,&lt;br /&gt;
not only in your layout of checked out working copies.&lt;br /&gt;
This has the advantage that many svn commands treat the whole thing as a single working copy.&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1619</id>
		<title>System Configurations</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1619"/>
		<updated>2007-06-11T13:18:22Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about &#039;&#039;&#039;how to&#039;&#039;&#039; manage configuration files (like &amp;lt;tt&amp;gt;/etc/*&amp;lt;/tt&amp;gt;) on your machine(s) using subversion.&lt;br /&gt;
&lt;br /&gt;
= Simple case =&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start off simple.&lt;br /&gt;
I assume you are root, as you are the one modifying the configuration files.&lt;br /&gt;
You first create a repository:&lt;br /&gt;
 svnadmin create /svn/configs&lt;br /&gt;
&lt;br /&gt;
Then you can make your root directory a working copy of this (so far empty) repository:&lt;br /&gt;
 svn checkout file:///svn/configs /&lt;br /&gt;
&lt;br /&gt;
Now you can start adding things you want to keep under revision control.&lt;br /&gt;
When adding directories, make sure to use the &amp;lt;tt&amp;gt;-N&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--non-recursive&amp;lt;/tt&amp;gt;) flag&lt;br /&gt;
to add only the directory itself and not all its contents.&lt;br /&gt;
And add directories before any files therein, although you may add both in the same command.&lt;br /&gt;
 svn add -N /etc /etc/fstab&lt;br /&gt;
&lt;br /&gt;
Now we want to have a look at what we modified so far.&lt;br /&gt;
A simple &amp;lt;tt&amp;gt;svn stat&amp;lt;/tt&amp;gt; will tell you all the things that are not under revision control so far.&lt;br /&gt;
When working with configuration files where you are not interested in many of them this is usually not what you want.&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--quiet&amp;lt;/tt&amp;gt;) flag suppresses those unmanaged files.&lt;br /&gt;
 svn stat -q /&lt;br /&gt;
&lt;br /&gt;
Now we are ready to commit our configurations to the repository.&lt;br /&gt;
It is usually a good idea to add and commit files &#039;&#039;before&#039;&#039; you modify them for the first time.&lt;br /&gt;
This way you can always compare any revision of the file to its &amp;quot;virgin&amp;quot; form supplied by your distribution.&lt;br /&gt;
And always write informative messages so you can later figure out not only what was changed but also why you changed it.&lt;br /&gt;
Remember to set &amp;lt;tt&amp;gt;EDITOR&amp;lt;/tt&amp;gt; for the root account as well if you do not supply the comment from the command line.&lt;br /&gt;
 svn commit / -m &amp;quot;vanilla files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You may want to have a list of all the files under version control.&lt;br /&gt;
Luckily you can combine the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; flag with &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--verbose&amp;lt;/tt&amp;gt;) to get just that:&lt;br /&gt;
 svn stat -qv /&lt;br /&gt;
&lt;br /&gt;
The basic work cycle probably is like this:&lt;br /&gt;
# if you modify file for the first time:&lt;br /&gt;
## add all parent dirs and the file itself&lt;br /&gt;
## commit&lt;br /&gt;
# edit the file&lt;br /&gt;
# check your modification works as expected, otherwise &amp;lt;tt&amp;gt;revert&amp;lt;/tt&amp;gt;&lt;br /&gt;
# list all modifications&lt;br /&gt;
# commit modifications, including message about the reason for this change&lt;br /&gt;
&lt;br /&gt;
= Basic concepts for multiple administrators &#039;&#039;or&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Maybe you are not the only one administrating the machine.&lt;br /&gt;
Assume there are several people who can become root and tweak the config files.&lt;br /&gt;
You would then want to know who changed what.&lt;br /&gt;
If you are accessing the repository using the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme you can simply provide&lt;br /&gt;
&amp;lt;tt&amp;gt;--username &amp;lt;/tt&amp;gt;&#039;&#039;yourName&#039;&#039; to provide this name for the record.&lt;br /&gt;
It does not even have to correspond to an existing system account.&lt;br /&gt;
 svn --username john commit /&lt;br /&gt;
&lt;br /&gt;
Maybe you decide to manage the configuration files for several machines in a single repository.&lt;br /&gt;
For the moment I&#039;ll consider the machines rather independent from one another,&lt;br /&gt;
so that you manage them in completely distinct trees of your repository.&lt;br /&gt;
Having them in the same repository still helps when diffing them,&lt;br /&gt;
applying changesets from one machine to another and so on,&lt;br /&gt;
so it&#039;s preferable to rather have subtrees in a single repository than different repositories.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s create a directory for a single machine in the above repository.&lt;br /&gt;
Note that we create dir directly in the repository, not in any checked out working copy.&lt;br /&gt;
 svn mkdir file:///svn/configs/macchina&lt;br /&gt;
&lt;br /&gt;
If you start off like this, you can simply check out the empty directory to the root directory of your machine,&lt;br /&gt;
instead of checking out the repository root as described above.&lt;br /&gt;
In case you started like described above and only later thought about adding other machines,&lt;br /&gt;
you&#039;ll need to move your existing contents to the new location:&lt;br /&gt;
 svn move file:///svn/configs/etc file:///svn/configs/macchina/etc&lt;br /&gt;
 svn switch file:///svn/configs/macchina /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure&#039;&#039;&#039; to first move the contents in the repository and only then switch your working copy,&lt;br /&gt;
because otherwise you might switch to an empty tree and all your versioned files would be deleted.&lt;br /&gt;
&lt;br /&gt;
You can then create additinal directories for other machines and check them out to their root directory.&lt;br /&gt;
Let&#039;s suppose you are working on a machine called &amp;lt;tt&amp;gt;maschine&amp;lt;/tt&amp;gt;. You could do the following:&lt;br /&gt;
 svn mkdir ssh+svn://root@macchina/svn/configs/maschine&lt;br /&gt;
 svn checkout ssh+svn://root@macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
= Advanced tricks for multiple administrators &#039;&#039;and&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Note that the trick for logging the user by passing &amp;lt;tt&amp;gt;--username&amp;lt;/tt&amp;gt;&lt;br /&gt;
to each command only works reasonably well with the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme.&lt;br /&gt;
It won&#039;t work with ssh access to another machine.&lt;br /&gt;
And it is easy enough to forget to provide your name.&lt;br /&gt;
We can solve all this and more by (ab)using the svn facility for defining tunnel applications.&lt;br /&gt;
&lt;br /&gt;
On every machine where you want to manage the configuration using svn,&lt;br /&gt;
first create the following file named &amp;lt;tt&amp;gt;/usr/local/bin/svn+sysadmin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Taken from http://www.orcaware.com/svn/wiki/System_Configurations&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   SYSADMIN=$(&lt;br /&gt;
     read -p &amp;quot;Your (non-root) login name: &amp;quot; NAME &amp;lt;/dev/tty &amp;gt;/dev/tty &amp;amp;&amp;amp; \&lt;br /&gt;
     echo &amp;quot;$NAME&amp;quot;&lt;br /&gt;
   )&lt;br /&gt;
 fi&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   echo &amp;quot;You need to give your name!&amp;quot; &amp;gt;/dev/tty&lt;br /&gt;
   exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 exec /usr/bin/ssh -l sysadmin-svn &amp;quot;$@&amp;quot; --tunnel-user=&amp;quot;${SYSADMIN}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Make it executable:&lt;br /&gt;
 chmod a+x /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
Register it in the &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[tunnels]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; section of your &amp;lt;tt&amp;gt;~/.subversion/config&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 [tunnels]&lt;br /&gt;
 sysadmin = /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
On the machine where the reporitory is, create a new user named &amp;lt;tt&amp;gt;sysadmin-svn&amp;lt;/tt&amp;gt;&lt;br /&gt;
and make it owner of the repository:&lt;br /&gt;
 chown -R sysadmin-svn /svn/configs&lt;br /&gt;
&lt;br /&gt;
To allow access to the repository, it is probably most convenient to create&lt;br /&gt;
a ssh public key for root on each machine (using &amp;lt;tt&amp;gt;ssh-keygen&amp;lt;/tt&amp;gt;).&lt;br /&gt;
I would consider it safe enough to not use a passphrase,&lt;br /&gt;
as this key only protects access to the repository and&lt;br /&gt;
if someone unauthorized managed to become root you are in trouble anyway.&lt;br /&gt;
You can then register all those keys in &amp;lt;tt&amp;gt;~sysadmin-svn/.ssh/authorized_keys&amp;lt;/tt&amp;gt;&lt;br /&gt;
on the machine with the repository to allow them all access to that account.&lt;br /&gt;
&lt;br /&gt;
Now you can move your machine config to this new scheme:&lt;br /&gt;
 svn switch --relocate ssh+svn://root@macchina/svn/configs/maschine ssh+sysadmin://macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Take care&#039;&#039;&#039; not to combine a &amp;lt;tt&amp;gt;switch --relocate&amp;lt;/tt&amp;gt; (to change scheme)&lt;br /&gt;
and a simple &amp;lt;tt&amp;gt;switch&amp;lt;/tt&amp;gt; (to change repository subtree) into a single step,&lt;br /&gt;
as I could imagine there would be trouble if you did so.&lt;br /&gt;
&lt;br /&gt;
Because you changed ownership of the repository,&lt;br /&gt;
it is probably easiest to access the repository through the &amp;lt;tt&amp;gt;ssh+sysadmin://&amp;lt;/tt&amp;gt; scheme&lt;br /&gt;
even on the machine where the repository lies.&lt;br /&gt;
This way you get the same behaviour no matter what machine you are on.&lt;br /&gt;
&lt;br /&gt;
Now whenever you access the configuration file repository,&lt;br /&gt;
you will asked your login name unless you set the &amp;lt;tt&amp;gt;SYSADMIN&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
Some commands like checkout make multiple connections,&lt;br /&gt;
so you&#039;ll have to provide your name multiple times.&lt;br /&gt;
&lt;br /&gt;
= Making use of the information =&lt;br /&gt;
&lt;br /&gt;
So what can you do now your files are under revision control?&lt;br /&gt;
&lt;br /&gt;
Suppose you are looking at some configuration file and want to know why some setting is the way it is.&lt;br /&gt;
You&#039;d [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.blame.html svn blame]&lt;br /&gt;
the file authors to see who edited it (that&#039;s what the user name logging is for)&lt;br /&gt;
and in which revision it was last modified.&lt;br /&gt;
You can then use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.log.html svn log]&lt;br /&gt;
to have a look at the message of that revision to get a clue why it was modified.&lt;br /&gt;
You can use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.cat.html svn cat]&lt;br /&gt;
or [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html svn diff]&lt;br /&gt;
to have a look at its previous setting.&lt;br /&gt;
And of course you can do [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.revert.html svn revert]&lt;br /&gt;
to undo changes you have not yet comitted and&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.merge.html svn merge]&lt;br /&gt;
to undo changes already comitted to the repository.&lt;br /&gt;
&lt;br /&gt;
= Sharing between machines =&lt;br /&gt;
&lt;br /&gt;
Above we were assuming completely independently configured machines.&lt;br /&gt;
&lt;br /&gt;
The opposite, completely identical machines, is almost as easy.&lt;br /&gt;
You remove any existing local config files and then check out a new copy of the tree.&lt;br /&gt;
You can then propagate configuration changes by comitting them on one machine and updating on all the others.&lt;br /&gt;
Whenever you put a file under revision control that existed on the machines before&lt;br /&gt;
you&#039;ll have to remove them before updating, which can be somewhat annoying.&lt;br /&gt;
I don&#039;t know any nice solution for this yet.&lt;br /&gt;
&lt;br /&gt;
How about mixed situations where some files are the same, but some others are not?&lt;br /&gt;
I would think it best to have two trees, one shared and one independent, checked out on each machine.&lt;br /&gt;
Of course only one of them can be the root.&lt;br /&gt;
Usually I&#039;d make this the independent tree unless you have very few differences.&lt;br /&gt;
You can then add symlinks from one tree to the other to get each configuration file from the correct tree.&lt;br /&gt;
&lt;br /&gt;
In case you made the independent tree your main working copy, you can graft the common tree using&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html svn:externals].&lt;br /&gt;
This way you model the tree composition in the repository as well,&lt;br /&gt;
not only in your layout of checked out working copies.&lt;br /&gt;
This has the advantage that many svn commands treat the whole thing as a single working copy.&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=Talk:System_Configurations&amp;diff=1618</id>
		<title>Talk:System Configurations</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=Talk:System_Configurations&amp;diff=1618"/>
		<updated>2007-06-11T08:52:00Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Reverted spam&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1582</id>
		<title>System Configurations</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1582"/>
		<updated>2007-01-08T13:41:59Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Wrote ideas about sharing (from irc discussion with ruxpin) and completed unfinished paragraph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about &#039;&#039;&#039;how to&#039;&#039;&#039; manage configuration files (like &amp;lt;tt&amp;gt;/etc/*&amp;lt;/tt&amp;gt;) on your machine(s) using subversion.&lt;br /&gt;
&lt;br /&gt;
= Simple case =&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start off simple.&lt;br /&gt;
I assume you are root, as you are the one modifying the configuration files.&lt;br /&gt;
You first create a repository:&lt;br /&gt;
 svnadmin create /svn/configs&lt;br /&gt;
&lt;br /&gt;
Then you can make your root directory a working copy of this (so far empty) repository:&lt;br /&gt;
 svn checkout file:///svn/configs /&lt;br /&gt;
&lt;br /&gt;
Now you can start adding things you want to keep under revision control.&lt;br /&gt;
When adding directories, make sure to use the &amp;lt;tt&amp;gt;-N&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--non-recursive&amp;lt;/tt&amp;gt;) flag&lt;br /&gt;
to add only the directory itself and not all its contents.&lt;br /&gt;
And add directories before any files therein, although you may add both in the same command.&lt;br /&gt;
 svn add -N /etc /etc/fstab&lt;br /&gt;
&lt;br /&gt;
Now we want to have a look at what we modified so far.&lt;br /&gt;
A simple &amp;lt;tt&amp;gt;svn stat&amp;lt;/tt&amp;gt; will tell you all the things that are not under revision control so far.&lt;br /&gt;
When working with configuration files where you are not interested in many of them this is usually not what you want.&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--quiet&amp;lt;/tt&amp;gt;) flag suppresses those unmanaged files.&lt;br /&gt;
 svn stat -q /&lt;br /&gt;
&lt;br /&gt;
Now we are ready to commit our configurations to the repository.&lt;br /&gt;
It is usually a good idea to add and commit files &#039;&#039;before&#039;&#039; you modify them for the first time.&lt;br /&gt;
This way you can always compare any revision of the file to its &amp;quot;vigin&amp;quot; form supplied by your distribution.&lt;br /&gt;
And always write informative messages so you can later figure out not only what was changed but also why you changed it.&lt;br /&gt;
Remember to set &amp;lt;tt&amp;gt;EDITOR&amp;lt;/tt&amp;gt; for the root account as well.&lt;br /&gt;
 svn commit /&lt;br /&gt;
&lt;br /&gt;
You may want to have a list of all the files under version control.&lt;br /&gt;
Luckily you can combine the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; flag with &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--verbose&amp;lt;/tt&amp;gt;) to get just that:&lt;br /&gt;
 svn stat -qv /&lt;br /&gt;
&lt;br /&gt;
The basic work cycle probably is like this:&lt;br /&gt;
# if you modify file for the first time:&lt;br /&gt;
## add all parent dirs and the file itself&lt;br /&gt;
## commit&lt;br /&gt;
# edit the file&lt;br /&gt;
# check your modification works as expected, otherwise &amp;lt;tt&amp;gt;revert&amp;lt;/tt&amp;gt;&lt;br /&gt;
# list all modifications&lt;br /&gt;
# commit modifications, including message about the reason for this change&lt;br /&gt;
&lt;br /&gt;
= Basic concepts for multiple administrators &#039;&#039;or&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Maybe you are not the only one administrating the machine.&lt;br /&gt;
Assume there are several people who can become root and tweak the config files.&lt;br /&gt;
You would then want to know who changed what.&lt;br /&gt;
If you are accessing the repository using the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme you can simply provide&lt;br /&gt;
&amp;lt;tt&amp;gt;--username &amp;lt;/tt&amp;gt;&#039;&#039;yourName&#039;&#039; to provide this name for the record.&lt;br /&gt;
It does not even have to correspond to an existing system account.&lt;br /&gt;
 svn --username john commit /&lt;br /&gt;
&lt;br /&gt;
Maybe you decide to manage the configuration files for several machines in a single repository.&lt;br /&gt;
For the moment I&#039;ll consider the machines rather independent from one another,&lt;br /&gt;
so that you manage them in completely distinct trees of your repository.&lt;br /&gt;
Having them in the same repository still helps when diffing them,&lt;br /&gt;
applying changesets from one machine to another and so on,&lt;br /&gt;
so it&#039;s preferable to rather have subtrees in a single repository than different repositories.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s create a directory for a single machine in the above repository.&lt;br /&gt;
Note that we create dir directly in the repository, not in any checked out working copy.&lt;br /&gt;
 svn mkdir file:///svn/configs/macchina&lt;br /&gt;
&lt;br /&gt;
If you start off like this, you can simply check out the empty directory to the root directory of your machine,&lt;br /&gt;
instead of checking out the repository root as described above.&lt;br /&gt;
In case you started like described above and only later thought about adding other machines,&lt;br /&gt;
you&#039;ll need to move your existing contents to the new location:&lt;br /&gt;
 svn move file:///svn/configs/etc file:///svn/configs/macchina/etc&lt;br /&gt;
 svn switch file:///svn/configs/macchina /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure&#039;&#039;&#039; to first move the contents in the repository and only then switch your working copy,&lt;br /&gt;
because otherwise you might switch to an empty tree and all your versioned files would be deleted.&lt;br /&gt;
&lt;br /&gt;
You can then create additinal directories for other machines and check them out to their root directory.&lt;br /&gt;
Let&#039;s suppose you are working on a machine called &amp;lt;tt&amp;gt;maschine&amp;lt;/tt&amp;gt;. You could do the following:&lt;br /&gt;
 svn mkdir ssh+svn://root@macchina/svn/configs/maschine&lt;br /&gt;
 svn checkout ssh+svn://root@macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
= Advanced tricks for multiple administrators &#039;&#039;and&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Note that the trick for logging the user by passing &amp;lt;tt&amp;gt;--username&amp;lt;/tt&amp;gt;&lt;br /&gt;
to each command only works reasonably well with the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme.&lt;br /&gt;
It won&#039;t work with ssh access to another machine.&lt;br /&gt;
And it is easy enough to forget to provide your name.&lt;br /&gt;
We can solve all this and more by (ab)using the svn facility for defining tunnel applications.&lt;br /&gt;
&lt;br /&gt;
On every machine where you want to manage the configuration using svn,&lt;br /&gt;
first create the following file named &amp;lt;tt&amp;gt;/usr/local/bin/svn+sysadmin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Taken from http://www.orcaware.com/svn/wiki/System_Configurations&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   SYSADMIN=$(&lt;br /&gt;
     read -p &amp;quot;Your (non-root) login name: &amp;quot; NAME &amp;lt;/dev/tty &amp;gt;/dev/tty &amp;amp;&amp;amp; \&lt;br /&gt;
     echo &amp;quot;$NAME&amp;quot;&lt;br /&gt;
   )&lt;br /&gt;
 fi&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   echo &amp;quot;You need to give your name!&amp;quot; &amp;gt;/dev/tty&lt;br /&gt;
   exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 exec /usr/bin/ssh -l sysadmin-svn &amp;quot;$@&amp;quot; --tunnel-user=&amp;quot;${SYSADMIN}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Make it executable:&lt;br /&gt;
 chmod a+x /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
Register it in the &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[tunnels]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; section of your &amp;lt;tt&amp;gt;~/.subversion/config&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 [tunnels]&lt;br /&gt;
 sysadmin = /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
On the machine where the reporitory is, create a new user named &amp;lt;tt&amp;gt;sysadmin-svn&amp;lt;/tt&amp;gt;&lt;br /&gt;
and make it owner of the repository:&lt;br /&gt;
 chown -R sysadmin-svn /svn/configs&lt;br /&gt;
&lt;br /&gt;
To allow access to the repository, it is probably most convenient to create&lt;br /&gt;
a ssh public key for root on each machine (using &amp;lt;tt&amp;gt;ssh-keygen&amp;lt;/tt&amp;gt;).&lt;br /&gt;
I would consider it safe enough to not use a passphrase,&lt;br /&gt;
as this key only protects access to the repository and&lt;br /&gt;
if someone unauthorized managed to become root you are in trouble anyway.&lt;br /&gt;
You can then register all those keys in &amp;lt;tt&amp;gt;~sysadmin-svn/.ssh/authorized_keys&amp;lt;/tt&amp;gt;&lt;br /&gt;
on the machine with the repository to allow them all access to that account.&lt;br /&gt;
&lt;br /&gt;
Now you can move your machine config to this new scheme:&lt;br /&gt;
 svn switch --relocate ssh+svn://root@macchina/svn/configs/maschine ssh+sysadmin://macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Take care&#039;&#039;&#039; not to combine a &amp;lt;tt&amp;gt;switch --relocate&amp;lt;/tt&amp;gt; (to change scheme)&lt;br /&gt;
and a simple &amp;lt;tt&amp;gt;switch&amp;lt;/tt&amp;gt; (to change repository subtree) into a single step,&lt;br /&gt;
as I could imagine there would be trouble if you did so.&lt;br /&gt;
&lt;br /&gt;
Because you changed ownership of the repository,&lt;br /&gt;
it is probably easiest to access the repository through the &amp;lt;tt&amp;gt;ssh+sysadmin://&amp;lt;/tt&amp;gt; scheme&lt;br /&gt;
even on the machine where the repository lies.&lt;br /&gt;
This way you get the same behaviour no matter what machine you are on.&lt;br /&gt;
&lt;br /&gt;
Now whenever you access the configuration file repository,&lt;br /&gt;
you will asked your login name unless you set the &amp;lt;tt&amp;gt;SYSADMIN&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
some commands like checkout make multiple connections,&lt;br /&gt;
so you&#039;ll have to provide your name multiple times.&lt;br /&gt;
&lt;br /&gt;
= Making use of the information =&lt;br /&gt;
&lt;br /&gt;
So what can you do now your files are under revision control?&lt;br /&gt;
&lt;br /&gt;
Suppose you are looking at some configuration file and want to know why some setting is the way it is.&lt;br /&gt;
You&#039;d [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.blame.html svn blame]&lt;br /&gt;
the file authors to see who edited it (that&#039;s what the user name logging is for)&lt;br /&gt;
and in which revision it was last modified.&lt;br /&gt;
You can then use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.log.html svn log]&lt;br /&gt;
to have a look at the message of that revision to get a clue why it was modified.&lt;br /&gt;
You can use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.cat.html svn cat]&lt;br /&gt;
or [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html svn diff]&lt;br /&gt;
to have a look at its previous setting.&lt;br /&gt;
And of yourse you can do [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.revert.html svn revert]&lt;br /&gt;
to undo changes you have not yet comitted and&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.merge.html svn merge]&lt;br /&gt;
to undo changes already comitted to the repository.&lt;br /&gt;
&lt;br /&gt;
= Sharing between machines =&lt;br /&gt;
&lt;br /&gt;
Above we were assuming completely independently configured machines.&lt;br /&gt;
&lt;br /&gt;
The opposite, completely identical machines, is almost as easy.&lt;br /&gt;
You remove any existing local config files and then check out a new copy of the tree.&lt;br /&gt;
You can then propagate configuration changes by comitting them on one machine and updating on all the others.&lt;br /&gt;
Whenever you put a file under revision control that existed on the machines before&lt;br /&gt;
you&#039;ll have to remove them before updating, which can be somewhat annoying.&lt;br /&gt;
I don&#039;t know any nice solution for this yet.&lt;br /&gt;
&lt;br /&gt;
How about mixed situations where some files are the same, but some others are not?&lt;br /&gt;
I would think it best to have two trees, one shared and one independent, checked out on each machine.&lt;br /&gt;
Of course only one of them can be the root.&lt;br /&gt;
Usually I&#039;d make this the independent tree unless you have very few differences.&lt;br /&gt;
You can then add symlinks from one tree to the other to get each configuration file from the correct tree.&lt;br /&gt;
&lt;br /&gt;
In case you made the independent tree your main working copy, you can graft the common tree using&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html svn:externals].&lt;br /&gt;
This way you model the tree composition in the repository as well,&lt;br /&gt;
not only in your layout of checked out working copies.&lt;br /&gt;
This has the advantage that many svn commands treat the whole thing as a single working copy.&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=User:Martin_von_Gagern&amp;diff=1581</id>
		<title>User:Martin von Gagern</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=User:Martin_von_Gagern&amp;diff=1581"/>
		<updated>2007-01-08T13:02:03Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Refer to wikipedia user page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [http://en.wikipedia.org/wiki/User:Martin_von_Gagern my user page on Wikipedia] for information about me.&lt;br /&gt;
Feel free to E-mail me, as I don&#039;t look here often enough to notice changes to my talk page.&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=Main_Page&amp;diff=1580</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=Main_Page&amp;diff=1580"/>
		<updated>2007-01-08T12:41:44Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: HowTo section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&#039;&#039;&#039;Welcome to the Subversion Wiki.&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Got a question about Subversion? ==&lt;br /&gt;
&lt;br /&gt;
Since this wiki seems to lack content at the moment, try the [http://subversion.tigris.org/faq.html Subversion FAQ].&lt;br /&gt;
&lt;br /&gt;
Also, there is [http://subversionary.org another wiki] related to Subversion.  At this time, it contains more content than this wiki.  However unlike this wiki, it doesn&#039;t use the more popular MediaWiki engine, and apprently, due to spam problems, was forced to shut off public editing.&lt;br /&gt;
&lt;br /&gt;
== HowTos ==&lt;br /&gt;
&lt;br /&gt;
* Manage [[System Configurations]] like &amp;lt;tt&amp;gt;/etc&amp;lt;/tt&amp;gt; files using subversion.&lt;br /&gt;
&lt;br /&gt;
== Contrib tools ==&lt;br /&gt;
&lt;br /&gt;
* [[svnmerge.py]] - Automatic branch management with merge tracking support.&lt;br /&gt;
* [[Repository Upgrade]] - Upgrade from an older repository to latest (1.4) (Windows)&lt;br /&gt;
&lt;br /&gt;
== MediaWiki help ==&lt;br /&gt;
&lt;br /&gt;
This wiki uses the MediaWiki software. Consult the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Help:Configuration_settings Configuration settings list]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]&lt;br /&gt;
* [http://mail.wikipedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1579</id>
		<title>System Configurations</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=System_Configurations&amp;diff=1579"/>
		<updated>2007-01-08T12:23:30Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Initial HowTo based on some personal experience&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is about &#039;&#039;&#039;how to&#039;&#039;&#039; manage configuration files (like &amp;lt;tt&amp;gt;/etc/*&amp;lt;/tt&amp;gt;) on your machine(s) using subversion.&lt;br /&gt;
&lt;br /&gt;
= Simple case =&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start off simple.&lt;br /&gt;
I assume you are root, as you are the one modifying the configuration files.&lt;br /&gt;
You first create a repository:&lt;br /&gt;
 svnadmin create /svn/configs&lt;br /&gt;
&lt;br /&gt;
Then you can make your root directory a working copy of this (so far empty) repository:&lt;br /&gt;
 svn checkout file:///svn/configs /&lt;br /&gt;
&lt;br /&gt;
Now you can start adding things you want to keep under revision control.&lt;br /&gt;
When adding directories, make sure to use the &amp;lt;tt&amp;gt;-N&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--non-recursive&amp;lt;/tt&amp;gt;) flag&lt;br /&gt;
to add only the directory itself and not all its contents.&lt;br /&gt;
And add directories before any files therein, although you may add both in the same command.&lt;br /&gt;
 svn add -N /etc /etc/fstab&lt;br /&gt;
&lt;br /&gt;
Now we want to have a look at what we modified so far.&lt;br /&gt;
A simple &amp;lt;tt&amp;gt;svn stat&amp;lt;/tt&amp;gt; will tell you all the things that are not under revision control so far.&lt;br /&gt;
When working with configuration files where you are not interested in many of them this is usually not what you want.&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--quiet&amp;lt;/tt&amp;gt;) flag suppresses those unmanaged files.&lt;br /&gt;
 svn stat -q /&lt;br /&gt;
&lt;br /&gt;
Now we are ready to commit our configurations to the repository.&lt;br /&gt;
It is usually a good idea to add and commit files &#039;&#039;before&#039;&#039; you modify them for the first time.&lt;br /&gt;
This way you can always compare any revision of the file to its &amp;quot;vigin&amp;quot; form supplied by your distribution.&lt;br /&gt;
And always write informative messages so you can later figure out not only what was changed but also why you changed it.&lt;br /&gt;
Remember to set &amp;lt;tt&amp;gt;EDITOR&amp;lt;/tt&amp;gt; for the root account as well.&lt;br /&gt;
 svn commit /&lt;br /&gt;
&lt;br /&gt;
You may want to have a list of all the files under version control.&lt;br /&gt;
Luckily you can combine the &amp;lt;tt&amp;gt;-q&amp;lt;/tt&amp;gt; flag with &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; (= &amp;lt;tt&amp;gt;--verbose&amp;lt;/tt&amp;gt;) to get just that:&lt;br /&gt;
 svn stat -qv /&lt;br /&gt;
&lt;br /&gt;
The basic work cycle probably is like this:&lt;br /&gt;
# if you modify file for the first time:&lt;br /&gt;
## add all parent dirs and the file itself&lt;br /&gt;
## commit&lt;br /&gt;
# edit the file&lt;br /&gt;
# check your modification works as expected, otherwise &amp;lt;tt&amp;gt;revert&amp;lt;/tt&amp;gt;&lt;br /&gt;
# list all modifications&lt;br /&gt;
# commit modifications, including message about the reason for this change&lt;br /&gt;
&lt;br /&gt;
= Basic concepts for multiple administrators &#039;&#039;or&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Maybe you are not the only one administrating the machine.&lt;br /&gt;
Assume there are several people who can become root and tweak the config files.&lt;br /&gt;
You would then want to know who changed what.&lt;br /&gt;
If you are accessing the repository using the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme you can simply provide&lt;br /&gt;
&amp;lt;tt&amp;gt;--username &amp;lt;/tt&amp;gt;&#039;&#039;yourName&#039;&#039; to provide this name for the record.&lt;br /&gt;
It does not even have to correspond to an existing system account.&lt;br /&gt;
 svn --username john commit /&lt;br /&gt;
&lt;br /&gt;
Maybe you decide to manage the configuration files for several machines in a single repository.&lt;br /&gt;
So let&#039;s create a directory for a single machine in the above repository.&lt;br /&gt;
Note that we create dir directly in the repository, not in any checked out working copy.&lt;br /&gt;
 svn mkdir file:///svn/configs/macchina&lt;br /&gt;
&lt;br /&gt;
If you start off like this, you can simply check out the empty directory to the root directory of your machine,&lt;br /&gt;
instead of checking out the repository root as described above.&lt;br /&gt;
In case you started like described above and only later thought about adding other machines,&lt;br /&gt;
you&#039;ll need to move your existing trees to the new location:&lt;br /&gt;
 svn move file:///svn/configs/etc file:///svn/configs/macchina/etc&lt;br /&gt;
 svn switch file:///svn/configs/macchina /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure&#039;&#039;&#039; to first move the contents in the repository and only then switch your working copy,&lt;br /&gt;
because otherwise you might switch to an empty tree and all your versioned files would be deleted.&lt;br /&gt;
&lt;br /&gt;
You can then create additinal directories for other machines and check them out to their root directory.&lt;br /&gt;
Let&#039;s suppose you are working on a machine called &amp;lt;tt&amp;gt;maschine&amp;lt;/tt&amp;gt;. You could do the following:&lt;br /&gt;
 svn mkdir ssh+svn://root@macchina/svn/configs/maschine&lt;br /&gt;
 svn checkout ssh+svn://root@macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
= Advanced tricks for multiple administrators &#039;&#039;and&#039;&#039; machines =&lt;br /&gt;
&lt;br /&gt;
Note that the trick for logging the user by passing &amp;lt;tt&amp;gt;--username&amp;lt;/tt&amp;gt;&lt;br /&gt;
to each command only works reasonably well with the &amp;lt;tt&amp;gt;file://&amp;lt;/tt&amp;gt; scheme.&lt;br /&gt;
It won&#039;t work with ssh access to another machine.&lt;br /&gt;
And it is easy enough to forget to provide your name.&lt;br /&gt;
We can solve all this and more by (ab)using the svn facility for defining tunnel applications.&lt;br /&gt;
&lt;br /&gt;
On every machine where you want to manage the configuration using svn,&lt;br /&gt;
first create the following file named &amp;lt;tt&amp;gt;/usr/local/bin/svn+sysadmin&amp;lt;/tt&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # Taken from http://www.orcaware.com/svn/wiki/System_Configurations&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   SYSADMIN=$(&lt;br /&gt;
     read -p &amp;quot;Your (non-root) login name: &amp;quot; NAME &amp;lt;/dev/tty &amp;gt;/dev/tty &amp;amp;&amp;amp; \&lt;br /&gt;
     echo &amp;quot;$NAME&amp;quot;&lt;br /&gt;
   )&lt;br /&gt;
 fi&lt;br /&gt;
 if &amp;lt;nowiki&amp;gt;[[ -z $SYSADMIN ]]&amp;lt;/nowiki&amp;gt;; then&lt;br /&gt;
   echo &amp;quot;You need to give your name!&amp;quot; &amp;gt;/dev/tty&lt;br /&gt;
   exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 exec /usr/bin/ssh -l sysadmin-svn &amp;quot;$@&amp;quot; --tunnel-user=&amp;quot;${SYSADMIN}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Make it executable:&lt;br /&gt;
 chmod a+x /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
Register it in the &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[tunnels]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; section of your &amp;lt;tt&amp;gt;~/.subversion/config&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 [tunnels]&lt;br /&gt;
 sysadmin = /usr/local/bin/svn+sysadmin&lt;br /&gt;
&lt;br /&gt;
On the machine where the reporitory is, create a new user named &amp;lt;tt&amp;gt;sysadmin-svn&amp;lt;/tt&amp;gt;&lt;br /&gt;
and make it owner of the repository:&lt;br /&gt;
 chown -R sysadmin-svn /svn/configs&lt;br /&gt;
&lt;br /&gt;
To allow access to the repository, it is probably most convenient to create&lt;br /&gt;
a ssh public key for root on each machine (using &amp;lt;tt&amp;gt;ssh-keygen&amp;lt;/tt&amp;gt;).&lt;br /&gt;
I would consider it safe enough to not use a passphrase,&lt;br /&gt;
as this key only protects access to the repository and&lt;br /&gt;
if someone unauthorized managed to become root you are in trouble anyway.&lt;br /&gt;
You can then register all those keys in &amp;lt;tt&amp;gt;~sysadmin-svn/.ssh/authorized_keys&amp;lt;/tt&amp;gt;&lt;br /&gt;
on the machine with the repository to allow them all access to that account.&lt;br /&gt;
&lt;br /&gt;
Now you can move your machine config to this new scheme:&lt;br /&gt;
 svn switch --relocate ssh+svn://root@macchina/svn/configs/maschine ssh+sysadmin://macchina/svn/configs/maschine /&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Take care&#039;&#039;&#039; not to combine a &amp;lt;tt&amp;gt;switch --relocate&amp;lt;/tt&amp;gt; (to change scheme)&lt;br /&gt;
and a simple &amp;lt;tt&amp;gt;switch&amp;lt;/tt&amp;gt; (to change repository subtree) into a single step,&lt;br /&gt;
as I could imagine there would be trouble if you did so.&lt;br /&gt;
&lt;br /&gt;
Because you changed ownership of the repository, it is probably easiest to &lt;br /&gt;
&lt;br /&gt;
Now whenever you access the configuration file repository,&lt;br /&gt;
you will asked your login name unless you set the &amp;lt;tt&amp;gt;SYSADMIN&amp;lt;/tt&amp;gt; environment variable.&lt;br /&gt;
some commands like checkout make multiple connections,&lt;br /&gt;
so you&#039;ll have to provide your name multiple times.&lt;br /&gt;
&lt;br /&gt;
= Making use of the information =&lt;br /&gt;
&lt;br /&gt;
So what can you do now your files are under revision control?&lt;br /&gt;
&lt;br /&gt;
Suppose you are looking at some configuration file and want to know why some setting is the way it is.&lt;br /&gt;
You&#039;d [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.blame.html svn blame]&lt;br /&gt;
the file authors to see who edited it (that&#039;s what the user name logging is for)&lt;br /&gt;
and in which revision it was last modified.&lt;br /&gt;
You can then use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.log.html svn log]&lt;br /&gt;
to have a look at the message of that revision to get a clue why it was modified.&lt;br /&gt;
You can use [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.cat.html svn cat]&lt;br /&gt;
or [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html svn diff]&lt;br /&gt;
to have a look at its previous setting.&lt;br /&gt;
And of yourse you can do [http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.revert.html svn revert]&lt;br /&gt;
to undo changes you have not yet comitted and&lt;br /&gt;
[http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.merge.html svn merge]&lt;br /&gt;
to undo changes already comitted to the repository.&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
	<entry>
		<id>https://www.orcaware.com/svn/mediawiki/index.php?title=Help:Editing&amp;diff=1578</id>
		<title>Help:Editing</title>
		<link rel="alternate" type="text/html" href="https://www.orcaware.com/svn/mediawiki/index.php?title=Help:Editing&amp;diff=1578"/>
		<updated>2007-01-08T10:50:33Z</updated>

		<summary type="html">&lt;p&gt;Martin von Gagern: Link to meta.wikimedia.org&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can have a look at [http://meta.wikimedia.org/wiki/Help:Editing Help:Editing on Meta-Wiki]&lt;/div&gt;</summary>
		<author><name>Martin von Gagern</name></author>
	</entry>
</feed>