# Where are xinitrc and xserverrc files?



## CarlManCity (Apr 30, 2014)

Hello! I am brand new to FreeBSD and I just installed it on my dad's old laptop. I am happy that so far I have installed X.Org and got the basic X window system running, and without any errors. I am still trying to understand X.Org and I am reading though the manuals. I know that when I enter `startx` it first looks for the .xinitrc file in the home directory to tell it how to load an X session, and that without this file, the system will look at the xinitrc file. When I do that it works fine. But the man page for startx(1) says the system wide xinitrc is located in the /usr/X11R6/lib/X11/xinit directory. But the /X11R6 directory is not in /usr or anywhere else. I searched for the xinitrc and the only location is /usr/local/etc/X11/xinit/ which is different from what the man page says. The man page also says the xserverrc file is in the same place as xinitrc but it is not anywhere at all. I guess it doesn't matter because everything is working and I could just create the .xinitrc and .xserverrc files in the home directory but because I want to understand how things work I would like to know if I don't have the /X11R6/lib/X11/xinit directory and the xinitrc, xserverrc system wide files because I did something wrong.  Thank you.


----------



## wblock@ (Apr 30, 2014)

CarlManCity said:
			
		

> Hello! I am brand new to FreeBSD and I just installed it on my dad's old laptop. I am happy that so far I have installed X.Org and got the basic X window system running, and without any errors. I am still trying to understand X.Org and I am reading though the manuals. I know that when I enter `startx` it first looks for the .xinitrc file in the home directory to tell it how to load an X session, and that without this file, the system will look at the xinitrc file. When I do that it works fine. But the man page for startx(1) says the system wide xinitrc is located in the /usr/X11R6/lib/X11/xinit directory.



Mine says

```
The   system-wide   xinitrc  and  xserverrc  files  are  found  in  the
       /usr/local/etc/X11/xinit directory.
```

locate(1) agrees.


----------



## fonz (Apr 30, 2014)

/usr/X11R6/lib/X11 is old and un-BSD. xinitrc is in /usr/local/etc/X11/xinit, which is where it belongs on a FreeBSD system. On my system the man page actually says the latter, so please tell me which version of X.Org you're running. A system wide xserverrc doesn't exist by default as far as I know.

P.S. Please fix your username. It should be @CarlLiverpool


----------



## CarlManCity (Apr 30, 2014)

wblock@ said:
			
		

> Mine says
> 
> ```
> The   system-wide   xinitrc  and  xserverrc  files  are  found  in  the
> ...



Yes thank you, that is also where my xinitrc file is located. But there is nothing else in that directory. The xserverrc file is not there or anywhere else at all. I was confused because the man page said both would be located in the /usr/X11R6/lib/X11/xinit directory but I did not have the /X11R6 directory in /usr or anywhere else.


----------



## CarlManCity (May 1, 2014)

fonz said:
			
		

> P.S. Please fix your username. It should be @CarlLiverpool



Oh no no no sir! :beer



			
				fonz said:
			
		

> /usr/X11R6/lib/X11 is old and un-BSD. xinitrc is in /usr/local/etc/X11/xinit, which is where it belongs on a FreeBSD system. On my system the man page actually says the latter, so please tell me which version of X.Org you're running. A system wide xserverrc doesn't exist by default as far as I know.



Thank you - you have pointed me in the right direction now. I used the pkg command to download and install X.Org so it is the latest version. Also the result from `pkg info xorg` shows the version to be 7.7. But when you mentioned the man page on your system it made me think. I was not reading from the startx(1) man page on my own system but instead the man page on freebsd.org. Only now did I realize that it was the man page for XFree86. But when I changed the system in the drop down menu to any of the FreeBSD releases there is no information for startx(1). Why are there other systems listed for man pages on FreeBSD.org anyway?

Well I called for my own system's man page for startx(1) and yes - it does say as you say that xinitrc is in /usr/local/etc/X11/xinit which is great because that's where mine is! But it still also says that the xserverrc file is also in that directory. But if you say that the file doesn't exist by default then I'm glad to know that because I don't have that file anywhere at all. But then why should the man page say that it's found in that directory?

Thank you for helping.


----------



## fonz (May 1, 2014)

CarlManCity said:
			
		

> But when I changed the system in the drop down menu to any of the FreeBSD releases there is no information for startx(1).


X.Org is not part of FreeBSD itself, it's third-party software we call a port. If you select one of the _"... and Ports"_ options, or just _"FreeBSD Ports"_ you'll find the right man page.


			
				CarlManCity said:
			
		

> But if you say that the file doesn't exist by default then I'm glad to know that because I don't have that file anywhere at all. But then why should the man page say that it's found in that directory?


That directory is probably where it should be *if* it's there in the first place. If that is indeed so, then I suppose the wording in the man page might be somewhat unfortunate.


----------



## kpa (May 1, 2014)

The manual pages for ports at http://www.freebsd.org are quite badly out of date, I wouldn't trust them much. For example the manual pages for dns/unbound are almost four years out of date and are missing some very important configuration settings.


----------



## wblock@ (May 1, 2014)

The man page for startx(1) in the first post goes to what appears to be the same one as I see locally.  It does not mention X11R6 at all.


----------



## CarlManCity (May 1, 2014)

wblock@ said:
			
		

> The man page for startx(1) in the first post goes to what appears to be the same one as I see locally.  It does not mention X11R6 at all.


Yes that's because even though it was a man page on freebsd.org I didn't realize I was actually looking at a page for an XFree86 system and it states that the xinitrc and xserverrc files are in /usr/X11R6/lib/X11/xinit.



			
				fonz said:
			
		

> X.Org is not part of FreeBSD itself, it's third-party software we call a port. If you select one of the _"... and Ports"_ options, or just _"FreeBSD Ports"_ you'll find the right man page.



Thanks - I did actually check _"FreeBSD 8.3-Release and Ports"_ because it's the version I installed and there was no information for `startx(1)`. But you are right that _"...and Ports"_ does display the page for `startx(1)` but for some reason all versions except 8.2, 8.3, and 8.4.

Anyways, the ports pages gives even another location for the xinitrc and xserverrc files: /usr/local/lib/X11/xinit! I checked the ports pages for a few versions but I'm assuming it says that for all versions. So I guess it is true what's been said here - that some man pages for ports are out of date. I guess I can maybe understand that if maybe people who use a port are probably already really familiar with it. Not great for someone like me though who is just learning things. Good thing there's a forum!


----------

