# Deleting .serverauth.xxxx



## balanga (Feb 18, 2020)

There a numerous .serverauth.xxxx files in my home directory which apparently stay around when startx exits ungracefully. How do I get daily periodic cleanup to remove these files?


----------



## SirDice (Feb 18, 2020)

You would have to write something yourself. As far as I know none of the 'standard' periodic(8) scripts will do this for you.

Note that the numerous .serverauth.* files are a symptom. What you're basically try to do is to get rid of the symptoms when you really should try to solve the reason why those files are left over in the first place. Fix the problem not the symptoms.


----------



## balanga (Feb 18, 2020)

As I understand it the .serverauth.* are holdovers from when startx exits ungracefully, such as when the system crashes/reboots unexpectedly... Maybe I should try to delete them as a step in `.xinitrc`...


----------



## Sevendogsbsd (Feb 18, 2020)

I thought they were from xorg requiring authentication? There is a line in startx about "xauth" (I think) which is set to true, but commenting this out only masks the issue as SirDice pointed out. I have had this issue before but now my system is working fine and I only have one .serverauth.* file. I am not sure what causes multiple instances of these files.


----------

