# Making Coda installation on Gentoo more user-friendly

## Griffon26

I've been wanting to use a network file system for easy access and increased reliability for a while now. Unfortunately, the installation of Coda (the most likely candidate for my needs from a technical point of view) is not at all user-friendly. I think it's time to change that. I have seen many times before that gentoo ebuilds and configuration files simplified otherwise complicated processes and I have the feeling that this could help broaden Coda's user base.

The purpose of this thread as I see it now is to identify configuration parameters, come up with easy to understand instructions for the average user and create an ebuild/script to automate the setup based on a simple configuration file.

Some issues with the install that need to be addressed have been mentioned in https://bugs.gentoo.org/show_bug.cgi?id=26132

Anyone who has an interest in running Coda, please consider contributing to this effort. Please report anything unintuitive/inconsistent along with a way to improve things.

----------

## Chewi

Coda seems like the answer to my prayers and I really want it to work. I tried about a month ago and I gave it another shot last night and just now but I just can't get the client half to work right at all.

For starters, there is the seemingly unnecessary codasrv dependency in the /etc/init.d/venus script. I have removed this on my installation.

I've managed to get the server side to work but the scripts expect the usual /vice folder to be /var/lib/vice. As long as you do that, it should work fine. But of course, the server is not much use without the client.

I've tried to client with the official test server and also with my own server. Venus appears to start okay but all I get is an empty folder that complains about being read-only if I try to write to it. This is what Venus says on startup.

```
15:35:26 /usr/coda/LOG size is 564568 bytes

15:35:26 /usr/coda/DATA size is 2258272 bytes

15:35:26 Initializing RVM data...

15:35:26 ...done

15:35:26 Loading RVM data

15:35:26 Starting RealmDB scan

15:35:26        Found 1 realms

15:35:26 starting VDB scan

15:35:26        0 volume replicas

15:35:26        0 replicated volumes

15:35:26        0 CML entries allocated

15:35:26        0 CML entries on free-list

15:35:26 starting FSDB scan (833, 20000) (25, 75, 4)

15:35:26        0 cache files in table (0 blocks)

15:35:26        833 cache files on free-list

15:35:27 starting HDB scan

15:35:27        0 hdb entries in table

15:35:27        0 hdb entries on free-list

15:35:27 Initial LRDB allocation

15:35:27 Mounting root volume...

15:35:27 Venus starting...

15:35:27 /mnt/coda now mounted.
```

----------

## Griffon26

You need to use clog to log in and get write access.

See the last step in http://info.pittsburgh.intel-research.net/bkm/coda_cli.html

There's only one problem...

where do we get a valid login+pass?

----------

## Chewi

I know about clog but that isn't necessary for the official test server. It's writable for everybody. And I couldn't even see any files there. Plus it would say "permission denied" and not "read-only filesystem".

----------

## Griffon26

Are you sure the test server still works? What do you think is the problem?

If you think it's your client setup, why don't you try to setup your own server as well and use that?

Edit: I figured it out. After seeing in venus.conf that "the default realm [...] is only used by clog/ctokens etc.", it got me wondering: how does the client know to access the test server at cmu?

Some googling made clear that the root (/mnt/coda) is read-only and contains a directory for each of the realms you contact (dir name = host name). Try ls testserver.coda.cs.cmu.edu. Then you can create stuff within that dir.

----------

## Chewi

As I said, I tried both the test server and my own server with the same result. I cannot access any folders in /mnt/coda because it's empty!

I am also experiencing the problem you mentioned here about codasrv not exiting. Use the --background option for start-stop-daemon seems to fix that.

When I try to stop it again though, I get this error. It does actually stop after a short time.

```
 * Stopping codasrv...

V_BindToServer: binding to host perkins

RPC2_NewBinding to server perkins failed with RPC2_NOBINDING (F)
```

----------

## Griffon26

I know /mnt/coda is empty. The directory for the realm is created when you ls it. Humour me, try ls -al testserver.coda.cs.cmu.edu

----------

## Chewi

Whoa. It worked! That's really weird.  :Shocked:  I was just getting ready to type "As much as I wanted to believe you, sorry, but it didn't work." You sure showed me.

----------

## Griffon26

I think they changed this since 6.0.3. I know I have successfully used that server once before, but I can't remember having to ls the hostname.

----------

## Griffon26

I was looking at automatic configuration and I realized I need at least some information from the user, like partition sizes and locations. Is there an acceptable way to gather user input (either interactively or from a configuration file) during pkg_config?

And another question: does anyone know what the random tokens that I entered in vice-setup (update authentication, auth2 authentication and volutil authentication) are for? Am I ever going to encounter these again? 

It seems there are a lot of configuration items (random tokens, user ids, server ids, ...) of which I'm not sure why I need to provide them.

----------

## Andersson

Better documentation and an ebuild is a great idea. I'll make another shot at the installation tomorrow or tuesday and see if I can contribute with something.

----------

## Griffon26

Be sure to check out the patches attached to https://bugs.gentoo.org/show_bug.cgi?id=26132

I already have some improvements even on the ones that are there, but for now they will do.

Edit: oh, almost forgot... don't forget to add --background to the codasrv init script:

```

        ebegin "Starting codasrv"

        start-stop-daemon --start --background --exec /usr/sbin/codasrv

        eend $?

```

----------

## Andersson

I've been reading through all the guides and discussions again, but I have not been able to make room for a new partition. I don't think I have room for coda until I can get a new hard drive.  :Wink: 

I don't quite understand how the partition coda stores the data on is used. Is it a normal partition with an ext2 file system that can be mounted normally and exported with samba? Or do I need a local coda client on the server and export /mnt/coda/ with samba to be able to see the files from windows?

----------

## Griffon26

 *Andersson wrote:*   

> I've been reading through all the guides and discussions again, but I have not been able to make room for a new partition. I don't think I have room for coda until I can get a new hard drive. 

 

You don't need to have any separate partitions for coda if all you want to do is try it out. The vice-setup script will ask you for a log partition, but you can just fill in a file. They forgot to add the "or file" part to the question about the RVM log. In the next question about RVM data they did add it.

 *Andersson wrote:*   

> I don't quite understand how the partition coda stores the data on is used. Is it a normal partition with an ext2 file system that can be mounted normally and exported with samba?

 

They call it a partition in coda (vicepa = vice partition a), but it is actually just a directory in your normal dir structure. They may have said something about a recommendation to put it on a separate partition, but I'm not sure. It can just be a directory on a partition with any file system, but apparently there are some problems if it is a journalling one (haven't noticed them yet though).

 *Andersson wrote:*   

>  Or do I need a local coda client on the server and export /mnt/coda/ with samba to be able to see the files from windows?

 

Yes, you do, because the files stored in vicepa are just files. All meta data is stored in RVM iirc, so that means location in the directory structure as well as the actual name of the file.

Let me know if you encounter any problems.

Btw, do you think there are any items in the vice-setup that can be set to default values for a basic configuration? I'm sure there will be some that the user needs to supply, so if you have any ideas about how to do this, let me know (see my post on Jul 04, 2004 11:23 am).

----------

## cprior

It might be obvious to the power-user, but at first I didn't have the appropriate kernel module compiled in:

```
cat /proc/filesystems
```

should show a line like 

```
nodev   coda
```

----------

## Griffon26

If anyone's still interested in trying out coda... I just checked in a modification to the coda-6.0.6 ebuild that allows you to setup a simple coda server and client with the following command:

ebuild /var/db/pkg/net-fs/coda-6.0.6/coda-6.0.6.ebuild config

This should enable people to get started more easily.

----------

## tecknojunky

code-6.0.7 has a dependency that's not in portage (rpc2-1.23)

----------

## Griffon26

I noticed, sorry about that. Sync again and it should be fixed.

----------

## tecknojunky

Thanks, it's fixed now.

 *Griffon26 wrote:*   

> If anyone's still interested in trying out coda... I just checked in a modification to the coda-6.0.6 ebuild that allows you to setup a simple coda server and client with the following command:
> 
> ebuild /var/db/pkg/net-fs/coda-6.0.6/coda-6.0.6.ebuild config
> 
> This should enable people to get started more easily.

 I'm not very hot at the idea of changing the placements of folders other than what the authors intended because it's confusing, but I can live with it.

There's something I don't understand about your config setup.  vicepa ends up inside of vice.  The problem is that Coda does not play well with journalized file systems.  The solution is to simply mount a separate ext2 partition on vicepa.

I unmounted my /vicepa and tried to mount it in your (odd) vice placment).  So, I did: 

```
manitou root # mkdir -p /var/lib/vice/vicepa

manitou root # umount /vicepa

manitou root # mount /dev/primaire/vicepa /var/lib/vice/vicepa

manitou root # ebuild /var/db/pkg/net-fs/coda-6.0.7/coda-6.0.7.ebuild config

 * This default configuration of coda will require 350MB of free space

 * for Recoverable Virtual Memory. Additional space is required for

 * the files that you store on your coda volume.

 

 * Please specify where coda should store this data [/var/lib/vice]:

 

 * Please remove the following items manually first if you want to

 * set up a default coda configuration:

 *      /var/lib/vice

 *      /var/lib/vice/vicepa

```

Now I have to turn into an anal-yst and fix your mess  :Wink:   :Razz:   :Very Happy:   (I just commented the "exit 1").

Still, I'm getting the error:

```
  * Unable to create root volume, output of createvol_rep follows

Failed to dump the current VRDB into /var/lib/vice/db/VRList.new
```

I salute your efforts, I usually get around well in installing stuffs, but Coda is just too complicated, not at all well documented, and the mailing-lists contains mostly unanswered questions (meaning that there's no support).

I'm lurking toward GFS now.

Edit:

I manually followed the steps in the config.  I had a little trouble with createvol_rep which had its parameters changed (but nowhere are the docs mentionning that, and vice-setup will even give the old format!), but once I figured it out, I ended up exactly where I was before:

I clog, but ctokens returns zip, and I can't do anything in /mnt/coda.  The ctokens part, I,m unsure about because I did not set the kerberos flag, so maybe it's normal that ctokens returns nothing (Solved: using "ctokens root@manitou.inet" prints the ticket).  Still, I can't access /mnt/coda.

```
# ls -ls /mnt/coda/manitou.inet/test

/bin/ls: /mnt/coda/manitou.inet/test: Aucun fichier ou répertoire de ce type
```

The sole thing I manage to get printed is this:

```
 # ls -al /mnt/coda/manitou

lrw-r--r--  1 root nobody 10 oct 25 01:26 /mnt/coda/manitou -> #@manitou

```

Edit2: The annoying Moi again  :Sad: 

I can do this: 

```
# cd /mnt/coda/manitou.inet

manitou manitou.inet # touch me

manitou manitou.inet # echo "test" > me

manitou manitou.inet # cat me

test

manitou manitou.inet # ls

/bin/ls: lecture du répertoire .: N'est pas un répertoire

manitou manitou.inet # ls -l me

-rw-r--r--  1 6000 nobody 5 oct 25 02:10 me

manitou manitou.inet # rm me

manitou manitou.inet # _

```

So, it seem I just can't "see" the content with ls if it's not a precice file.  For example, ls *, ls . or whatever to get the folder's content will bork.

Does it show that I'm completely clueless  :Confused:  ?

----------

## Griffon26

I'll get back to you tonight when I have more time (I'm at work now), but here's some explanation.

The config is meant to allow people to try out coda without having to go through the process of getting to know it intimately before they actually decide if it is useful for them. For new users it is not a very big problem to have the vice partition on a journalled fs. If you only try it out, you are not gonna make a separate partition for it anyway.

It would not be possible to cater to the wishes of more experienced users from pkg_config without making it hard for other people. Besides, most of the functionality those experienced users are looking for is present in vice-setup as is.

Now let me explain what the config does.

It asks you for the location of the rvm log and data partition and the vice partition. The default location of this is /var/lib/vice, as that is what the File Hierarchy Standard (http://www.pathname.com/fhs/) prescribes. Personally I usually use /home/coda, because I have a little more room there.

The config has to recreate several files and directories. To make sure that people do not accidentally destroy a working coda setup, the user has to explicitly remove these files and directories himself. 

Once the files/dirs have been removed and the config is rerun, the config should be able to setup the entire installation for you, including a writable volume.

The error you ran into is something that I also saw on one of my machines yesterday. I'm working on a solution, but for now you can add a "sleep 1" after /etc/init.d/codasrv start.

I urge you to give the config another chance with this modification. You can tinker with the default installation for a while and once you feel comfortable with coda, you can try setting it up yourself with vice-setup. If you screw up, all you have to do is restart with the config and you'll be back to the basic, but working setup.

----------

## tecknojunky

 *Griffon26 wrote:*   

> I'll get back to you tonight when I have more time (I'm at work now), but here's some explanation.

 Oh please do.  I'm so discouraged.  (I gues you are talking about "your" tonight, not mine  :Wink: )

 *Griffon26 wrote:*   

> The config is meant to allow people to try out coda without having to go through the process of getting to know it intimately before they actually decide if it is useful for them. For new users it is not a very big problem to have the vice partition on a journalled fs. If you only try it out, you are not gonna make a separate partition for it anyway.
> 
> It would not be possible to cater to the wishes of more experienced users from pkg_config without making it hard for other people. Besides, most of the functionality those experienced users are looking for is present in vice-setup as is.

 Fair enough.  I admit I tought of it more as some way to install it, not to try it.  I have been thrue the install a couple of times by myself already, to the point of even doing my own partition setups with the rvm tools.  But since I never was able to use coda, I tought I'd give your script a run.

 *Griffon26 wrote:*   

> Now let me explain what the config does.
> 
> It asks you for the location of the rvm log and data partition and the vice partition. The default location of this is /var/lib/vice, as that is what the File Hierarchy Standard (http://www.pathname.com/fhs/) prescribes. Personally I usually use /home/coda, because I have a little more room there.
> 
> The config has to recreate several files and directories. To make sure that people do not accidentally destroy a working coda setup, the user has to explicitly remove these files and directories himself. 
> ...

 I understand.

 *Griffon26 wrote:*   

> The error you ran into is something that I also saw on one of my machines yesterday. I'm working on a solution, but for now you can add a "sleep 1" after /etc/init.d/codasrv start.

 I think you need much more than a 1 second sleep.  According to the post install messages given by vice-setup, it tells, you to watch SrvLog and wait for the server to be started.  This takes close to one minute on my box.  As a matter of fact, I still have it. here it is: 

```
# tail -f -n 40 /var/lib/vice/srv/SrvLog

 

Date: Mon 10/25/2004

 

00:23:28 Coda Vice, version 6.0.7       log started at Mon Oct 25 00:23:28 2004

 

00:23:28 Resource limit on data size are set to -1

 

00:23:28 RvmType is Rvm

00:23:28 Main process doing a LWP_Init()

00:23:28 Main thread just did a RVM_SET_THREAD_DATA

 

00:23:28 Setting Rvm Truncate threshhold to 5.

 

Partition /var/lib/vice/vicepa: inodes in use: 0, total: 2097152.

00:24:39 Partition /var/lib/vice/vicepa: 19593852K available (minfree=5%), 19593848K free.

00:24:39 The server (pid 32370) can be controlled using volutil commands

00:24:39 "volutil -help" will give you a list of these commands

00:24:39 If desperate,

                "kill -SIGWINCH 32370" will increase debugging level

00:24:39        "kill -SIGUSR2 32370" will set debugging level to zero

00:24:39        "kill -9 32370" will kill a runaway server

00:24:39 VCheckVLDB:  bad VLDB!

00:24:39 VInitVolPackage: no VLDB! Please create a new one.

00:24:39 Vice file system salvager, version 3.0.

00:24:39 SanityCheckFreeLists: Checking RVM Vnode Free lists.

00:24:39 DestroyBadVolumes: Checking for destroyed volumes.

00:24:39 Salvaging file system partition /var/lib/vice/vicepa

00:24:39 Force salvage of all volumes on this partition

00:24:39 Scanning inodes in directory /var/lib/vice/vicepa...

00:24:39 SalvageFileSys completed on /var/lib/vice/vicepa

00:24:39 release_locks: unable to release file server lock

00:24:39 release_locks: unable to release volume utility lock

00:24:39 Attached 0 volumes; 0 volumes not attached

lqman: Creating LockQueue Manager.....LockQueue Manager starting .....

00:24:39 LockQueue Manager just did a rvmlib_set_thread_data()

 

done

00:24:39 CallBackCheckLWP just did a rvmlib_set_thread_data()

 

00:24:39 CheckLWP just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 0 just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 1 just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 2 just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 3 just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 4 just did a rvmlib_set_thread_data()

 

00:24:39 ServerLWP 5 just did a rvmlib_set_thread_data()

 

00:24:39 ResLWP-0 just did a rvmlib_set_thread_data()

 

00:24:39 ResLWP-1 just did a rvmlib_set_thread_data()

 

00:24:39 VolUtilLWP 0 just did a rvmlib_set_thread_data()

 

00:24:39 VolUtilLWP 1 just did a rvmlib_set_thread_data()

 

00:24:39 Starting SmonDaemon timer

00:24:39 File Server started Mon Oct 25 00:24:39 2004
```

So, to be exact, it takes 1m11s.  So I would need a "sleep 71"  :Very Happy: 

 *Griffon26 wrote:*   

> I urge you to give the config another chance with this modification. You can tinker with the default installation for a while and once you feel comfortable with coda, you can try setting it up yourself with vice-setup. If you screw up, all you have to do is restart with the config and you'll be back to the basic, but working setup.

 Like I said, I had your config up in one xterm while I was typing them manualy into another.    Basically, it worked, just that I end up to the exact same place as before.

So, i think, my problems is that I don't know how to use Coda.  It seems to work, but I would expect that if I clog as codaroot, I could see what's inside the /mnt/coda folder, or at least be able to lookup the contents of /mnt/coda/fqdn for which I have full acl access:

```
 # ctokens root@manitou.inet

Tokens held by the Cache Manager for root:

    @manitou.inet

        Coda user id:    6000

        Expiration time: Tue Oct 26 02:15:21 2004

manitou manitou.inet # cfs la .

      System:AnyUser  rl

System:Administrators  rlidwka

manitou manitou.inet # cfs la /mnt/coda

      System:AnyUser  rl

manitou manitou.inet # cfs la /mnt/coda/manitou.inet

      System:AnyUser  rl

System:Administrators  rlidwka

manitou manitou.inet # pdbtool

pdbtool> i 6000

USER codaroot

  *  id: 6000

  *  belongs to groups: [ -1 ]

  *  cps: [ -1 6000 ]

  *  owns groups: [ -1 ]

pdbtool> list

USER codaroot

  *  id: 6000

  *  belongs to groups: [ -1 ]

  *  cps: [ -1 6000 ]

  *  owns groups: [ -1 ]

USER System

  *  id: 1

  *  belongs to groups: [ -2 ]

  *  cps: [ -2 1 ]

  *  owns groups: [ -2 ]

GROUP System:AnyUser OWNED BY System

  *  id: -2

  *  owner id: 1

  *  belongs to no groups

  *  cps: [ -2 ]

  *  has members: [ 1 ]

GROUP System:Administrators OWNED BY codaroot

  *  id: -1

  *  owner id: 6000

  *  belongs to no groups

  *  cps: [ -1 ]

  *  has members: [ 6000 ]

pdbtool> exit

manitou manitou.inet # cfs sa /mnt/coda System:Administrator all

/mnt/coda: Operation not permitted

manitou manitou.inet # cfs sa /mnt/coda System:Administrators all

/mnt/coda: Operation not permitted

manitou manitou.inet # cfs sa /mnt/coda System:Administrators all

/mnt/coda: Operation not permitted
```

Still clueless.  :Sad: 

----------

## Griffon26

So ls -al /mnt/coda/manitou.inet doesn't work??

It should show you an empty dir until you create another volume and mount it in /mnt/coda/manitou.inet/mountpoint

----------

## tecknojunky

 *Griffon26 wrote:*   

> So ls -al /mnt/coda/manitou.inet doesn't work??

 No, it does not.  I can cd to it, I can create/modify/cat/remove and ls files indivicualy, but on the folder itself, nothing works.  I can't ls . or ls *.  /bin/ls always complain that it's not a folder.

----------

## Griffon26

I'm not so sure it should be possible to do anything with that directory. I get the feeling that they meant the coda root volume to simply be a container for other volumes. If you figure out either how to do it or that it is not possible, please let me know.

I'm sorry my experience with coda is still limited to what I figured out since starting this thread. Unfortunately the documentation isn't as up-to-date as one would like either.

In the mean time I am investigating what to do about the config not working on some machines.

----------

