Of course, this is a situation that can be wrought with dangers. Disgruntled tenants can sabotage the efforts to sell the property by any number of means. Landlords must be aware of and follow the letter of the law pertaining to the local Landlord-Tenant Code in giving proper notice to the tenants, and following all of the tenets of the code during the sales process.
Tenants are understandably dismayed; after all, what is more unsettling than the prospect of losing your home? Sometimes they want to retaliate, and strike back in unreasonable manners. Plenty of war stories can be told about that, too; Tenants staying in the unit during open houses, blasting music, having beer busts, etc.

There are plenty of helpful tips that I've heard to help relieve the stress and accommodate a smoother process to accomplish the task at hand, which is to sell the property. Some examples are to give the tenant a break on the rent in exchange for the inconvenience of the showings; buy them movie tickets to use while the realtor holds open houses. Make sure the tenant knows that if they present a good showing of themselves, an investor may want to keep them as tenants, causing minimal disturbance to their lives. A bad showing makes them look bad.
The main thing that the Seller must do, in my opinion, is to do all the nice things they can, but in addition, be informed of, and follow the law completely. Local Landlord-Tenant codes are just that - LOCAL. During the time when you market your tenant occupied proerty, you must be extremely careful to stay on the right side of the law, or be prepared for unexpected and unwelcome surprises. The worst thing that you could do is violate the code, by just slightly bending the rules, because you have such a great relationship with your tenant.
Here are some highlights of the Local Hawaii Landlord Tenant Code, regarding required timeliness of notice given by the landlord to the tenant. These highlights apply for week to week, month-to-month, and lease rentals. Check the code carefully for your situation:
Notice of Intent to Enter: 2 days
Failure to Pay Rent: 5 business days (Delivery of Notice to Pay or Quit)
Notice of Termination of Rental: Week-to-week, 10 days. Month-to-month, 45 days written notice from landlord to tenant. From Tenant to landlord, 28 days written notice. Lease, prior to expiration of lease.
Return of Security Deposit: 14 days after rental termination, or 14 days after lease expires.
Oh, goodness...yes....many a HORROR story to tell here Mike. And like you said...the best thing to do is ....make sure we all understand the laws. I had one....the seller had a room chum (who hardly ever paid him) and to the very end did not want to move. It worked out in the end but it was a HORROR story to be sure.