LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-21-2015, 07:56 AM   #1
Cpare
Member
 
Registered: Aug 2001
Location: Magic City, USA
Distribution: Ubuntu
Posts: 73

Rep: Reputation: 15
Who/What is using my Symbolic Link


on Friday we moved user home folders between NAS volumes, immediately afterwards we started seeing our application hanging and not responding. To restore service we created a symbolic link directing home folder calls to the new location.

Now that we have service restored we need to clean things up and make the transition complete, how do we find who/what is using the symbolic link? My goal is to identify the users/usage, correct the problem, and then monitor to ensure we don't see additional references before we remove the link. Measure/Adjust/Measure - Imaging that

For those that will ask "Why remove the link"?
(a) Keeping the system clean and easy to sustain is the right thing to do.
(b) The link lives on the old NAS volume that needs to be decommissioned.
 
Old 09-21-2015, 08:12 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I use lsof sometimes like so
Code:
lsof +D /directory/to/monitor
 
Old 09-21-2015, 10:19 AM   #3
Cpare
Member
 
Registered: Aug 2001
Location: Magic City, USA
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Habitual View Post
I use lsof sometimes like so
Code:
lsof +D /directory/to/monitor
Thanks for the suggestion, it gave me a good start!
 
Old 09-21-2015, 10:20 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
You are welcome!
 
Old 09-22-2015, 09:11 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
I would simply grep in the source-code directories. (Or even object-code.)
 
Old 09-22-2015, 11:12 AM   #6
Cpare
Member
 
Registered: Aug 2001
Location: Magic City, USA
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
Hello - as a follow-up to this it looks like the lsof is resulting the files locked weather the user is following the symbolic link or not.
 
Old 09-22-2015, 11:31 AM   #7
Cpare
Member
 
Registered: Aug 2001
Location: Magic City, USA
Distribution: Ubuntu
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sundialsvcs View Post
I would simply grep in the source-code directories. (Or even object-code.)
Good suggestion, however this is a vendors application with compiled code and configuration files stored in multiple locations including a database. As we hunt for all the places we need to update I need a way to monitor the users we are testing with to see if we have found all the settings before removing the symbolic link for all our users.
 
Old 09-23-2015, 08:00 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by Cpare View Post
Hello - as a follow-up to this it looks like the lsof is resulting the files locked weather the user is following the symbolic link or not.
What if instead of using the symlink you use "mount --bind" to remount the new home directory in the old location? lsof might behave as you hope in that case, not sure since ultimately they are still using the same files.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can I make a symbolic link that is dynamic link->$HOME/file? croog Linux - General 4 10-14-2012 07:55 PM
Symbolic link not allowed or link target not accessible rheluser Linux - Server 3 09-04-2012 10:22 AM
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 06:47 AM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 07:40 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 10:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration