Force (a clean) umount:
umount -l /path/to/mount
# the -l (lower case L) option is lazy unmount
From the man page for (-l):
Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all ref-erences to the filesystem as soon as it is not busy anymore.
(Requires kernel 2.4.11 or later.)
Yep. I forget things. I love to learn new things, but sometimes, I can't quite remember how I did them. Feel free to use this repository as I do: A vault of things I want to remember...
Wednesday, September 7, 2011
Thursday, September 1, 2011
LDAP search AD from linux: ldapsearch
So you have linux systems in a network that utilize LDAP via windows Active directory (AD), eh? Yea, cool stuff. The project came up as to how to monitor them, because the windows folks forget that a down domain controller (DC) means a down network. I digress...
Anywho, I was handed the project to monitor and alarm our AD (LDAP) domain controllers. I decided to write a nagios shell plugin, and the main query tool is the linux command: ldapsearch
# Explanation: (of course the man page help too... :)
-x = simple search
-D = who to use for authentication
-W = ask for password (-w "password" otherwise)
-b = where to begin search
-h = domain controller address (-H ldaps://<address> otherwise)
"(sn=XYZ)" = search for sn (sir_name=XYZ) [known as filter]
last part with cn, displayName, etc... = what to return
Good luck!
Anywho, I was handed the project to monitor and alarm our AD (LDAP) domain controllers. I decided to write a nagios shell plugin, and the main query tool is the linux command: ldapsearch
# Example search
ldapsearch -x -D "user_name@example.com" -W -b "DC=example,DC=com" -h example.com "(sn=last_name)" cn displayName mail sn
# RESULTS:
# user_name, (other domain info returned here)
dn: CN=user_name,OU=one,OU=two,OU=three,DC=example,DC=com
cn: user_name
sn: last_name
displayName: Last, Name, M.
mail: mail_user_name@example.com
ldapsearch -x -D "user_name@example.com" -W -b "DC=example,DC=com" -h example.com "(sn=last_name)" cn displayName mail sn
# RESULTS:
# user_name, (other domain info returned here)
dn: CN=user_name,OU=one,OU=two,OU=three,DC=example,DC=com
cn: user_name
sn: last_name
displayName: Last, Name, M.
mail: mail_user_name@example.com
-x = simple search
-D = who to use for authentication
-W = ask for password (-w "password" otherwise)
-b = where to begin search
-h = domain controller address (-H ldaps://<address> otherwise)
"(sn=XYZ)" = search for sn (sir_name=XYZ) [known as filter]
last part with cn, displayName, etc... = what to return
Good luck!
Subscribe to:
Posts (Atom)