# svnserve via inetd



## balanga (Jun 19, 2016)

I'm trying to start svnserve via inetd and when running:

`svn list svn://192.168.1.48/var/svn/myproject`


```
svn: E000061: Can't connect to host '192.168.1.48': Connection refused
```

My /etc/inetd.conf

`svn     stream  tcp     nowait  svn     /usr/local/bin/svnserve -i -r /var/svn`

`ls -al /var/svn/myproject`:-

```
drwxr-xr-x  6 www   www    512 Jun 14 15:18 .
drwxr-xr-x  3 root  wheel  512 Jun 14 17:26 ..
-rw-r--r--  1 www   www    246 Jun 14 15:18 README.txt
drwxr-xr-x  2 www   www    512 Jun 14 15:18 conf
drwxr-sr-x  6 www   www    512 Jun 14 15:18 db
-r--r--r--  1 www   www      2 Jun 14 15:18 format
drwxr-xr-x  2 www   www    512 Jun 14 15:18 hooks
drwxr-xr-x  2 www   www    512 Jun 14 15:18 locks
```

How can I tell if `svnserve` is getting launched from `inetd`?

Or is the problem related to file ownership or access control?

I don't have any authentication enabled at the moment AFAICT.


----------



## obsigna (Jun 20, 2016)

Is inetd running? It is disabled by default. If you really need to run svnserve by the way of inetd, then add to the file /etc/rc.conf the line:

```
inetd_enable="YES"
```


----------



## balanga (Jun 20, 2016)

obsigna said:


> Is inetd running? It is disabled by default. If you really need to run svnserve by the way of inetd, then add to the file /etc/rc.conf the line:
> 
> ```
> inetd_enable="YES"
> ```



inetd is definitely running, but I don't know how to tell if svnserve is getting launched properly....

Maybe I'll try and get svnserve running as a standalone daemon first and then add it to inetd once I know its working, but I'm not sure how to stop it if need be. Should I add svnserve to the file /etc/rc.conf


----------



## wblock@ (Jun 20, 2016)

There is a standard service-type file at /usr/local/etc/rc.d/svnserve.


----------



## balanga (Jun 20, 2016)

wblock@ said:


> There is a standard service-type file at /usr/local/etc/rc.d/svnserve.



So do I just need to run `sysrc svnserve_enable=yes` and then `service svnserve start`?

Do I need any parameters? I'm not sure if svnserve has a config file, although I've noticed there is a /etc/svn-users although I can't remember if I created that in my attempts to get devel/subversion working...


----------



## obsigna (Jun 21, 2016)

A few years ago, I wrote an article on my BLog about setting up a SVN server utilizing the svn:// scheme with SASL encryption.
http://blog.obsigna.net/?p=83

Regardless of the encryption, the basic setting up steps are the same, and I guess, said article could be useful to get your SVN service up and running. If you want to access your SVN server from inside the LAN only, then simply forget the part about SASL.


----------



## wblock@ (Jun 21, 2016)

I don't recall.  On my own server, I use ssh+svn, and it is not necessary to run `svnserve` separately.


----------



## obsigna (Jun 21, 2016)

I read the SVN Book before my SVN server deployment. Chapter 6 got a very nice overview about the different methods, and discussing its pro's and con's. After the reading, I had no doubt, that I wanted svnserver+SASL encryption. Others might like the other options, though.


----------



## Zeno Moson (Jul 8, 2016)

balanga said:


> inetd is definitely running, but I don't know how to tell if svnserve is getting launched properly....
> 
> Maybe I'll try and get svnserve running as a standalone daemon first and then add it to inetd once I know its working, but I'm not sure how to stop it if need be. Should I add svnserve to the file /etc/rc.conf


To run svnserve as a standalone daemon:
`svnserve -d --listen-host=0.0.0.0 -r $SVN_REPO_ROOT`
--listen-host=0.0.0.0 makes sure svn works on IPv4 since it defaults with IPv6. Without this parameter, svnserve -d will have the same problem as in original post. Thus I suspect the problem with inetd also has something to do with IPv4 vs. IPv6, haven't find a solution yet, though.
To stop svnserve:
`ps aux | grep svnserve`
should give you the PID for svnserve, then you can
`kill $SVNSERVE_PID`


----------

