statd/lockd startup failure

Andrea Venturoli ml at
Thu Feb 17 21:07:07 UTC 2011

On 02/17/11 04:28, Jeremy Chadwick wrote:
> On Wed, Feb 16, 2011 at 09:46:37PM -0500, Michael Proto wrote:
>> On Wed, Feb 9, 2011 at 9:20 AM,<george+freebsd at>  wrote:
>>> Under 8.2-PRERELEASE (GENERIC kernel), about 15% of the times I boot up
>>> (with rpc.statd and rpc.lockd enabled in rc.conf), I get:
>>> Feb  4 07:31:11 wonderland rpc.statd: bindresvport_sa: Address already in use
>>> Feb  4 07:31:11 wonderland root: /etc/rc: WARNING: failed to start statd
>>> and slightly later:
>>> Feb  4 07:31:36 wonderland kernel: NLM: unexpected error contacting NSM, stat=5, errno=35
>>> I can start rpc.statd and rpc.lockd manually at this point (and I have to
>>> start them to run firefox and mail with my NFS-mounted home directory and
>>> mail spool).  But what might cause the above errors?   -- George Mitchell
>>> _______________________________________________
>>> freebsd-stable at mailing list
>>> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at"
>> Don't rpc.statd and lockd try to choose a random port upon startup?

Yes, by default.

> I
>> seem to remember a similar problem I had a long time ago. I opted to
>> use a consistent, not-used port and haven't seen the problem since
>> (this was years ago, so I can't remember if the error you're seeing
>> was identical to mine).
>> /etc/rc.conf:
>> rpc_statd_flags="-p 898"
>> rpc_lockd_flags="-p 4045"

I have:
rpc_statd_flags="-p 918"
rpc_lockd_flags="-p 868"

Still statd occasionally fails to start.

It might be that something else has already bound to port 918, though I 
don't know what.
I'll check as soon as I have the chance.

> Locking down the port numbers as you showed is the best choice, plus
> allows for proper firewall rules to be added.  However, be aware not all
> daemons support this.  Reliable firewall rules for NFS = good luck.

Since I put the above in rc.conf, I've had more problems with NFS and ipfw.
I also vaguely remember some daemons having hooks to open ipfw ports 

  bye & Thanks

More information about the freebsd-stable mailing list