How to terminate cleanly another session left running? I am the admin on a shared MacOS X: Big_server running Yosemite.
The version of MacOS isn't a key information: I had the same kind of problem on all versions of MacOS.

But today I have a practical big case and time to analyze and test solutions.
Big_server is hosting professionnal services (firewall and mail server)
and can't be rebooted to play.

I have another user bob who left his session open.
He forgot to close it and is on vacation for many weeks.
Hence the console is locked waiting for his password.
I know how to kill bob's session like a pig.

However, I noticed that this colleague has more than 50 processes running,
some of them terminating with:

...Support/photolibraryd
.../com.apple.CloudPhotosConfiguration
...


and I would like to avoid corrupting any of his libraries or files
which might have been left opened.

How may I terminate cleanly bob's session without corrupting his data?
Bob’s user can send a Kill signal to all their processes. 

sudo su - bob
kill -9 -1


This leaves all non Bob processes running and sends the non maskable SIGKILL to all processes by that UID. On newer os, some processes will respawn as uses Bob, but you’ll have cleaned them up momentarily and the old session will be gone.