You are not logged in.
Hey everyone, I'm wracking my brain, but is there any command that exists that can find out what process makes use of certain config files? For example, is there something I run or query that points to the volti daemon if I run it against .config/volti/config?
I mean some are obvious like that but I'd love to plunge into the deeper levels of the filesystem and see some non obvious files and what makes use of them.
I know dpkg has a dependencies check, but it's not really the same thing, as that is more about full packages, not individual files.
Could a script like this be written if it doesn't already exist? Maybe something to check to see what process last opened the file?
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
You are starting your journey into the void of Linux.
What you are looking for is understanding how the Kernel works and its Monolithic Fashion of Operation. All software is depended on the Kernel, so you would like to start there and build your explorer program from root directory. The people that came before you have left their legacy behind for you to discover and use, be careful tho because what you are looking for are the deamon programs running and logging in the background.
Start at /var/log to see what the deamons are writing. It is all manual operation from this point, I suggest you put some color on the terminal first
PS1='\[\e[0;32m\][\u@\h\w]\€\[\e[0;34m\] '
Happy mining
sharp, clarity, focus, control
Offline
^ wot? ach, nevermind.
is there any command that exists that can find out what process makes use of certain config files? For example, is there something I run or query that points to the volti daemon if I run it against .config/volti/config?
if the process is using the config file atm, yes, with "lsof" (but i don't know exactly how).
if not, no. not directly.
i think it's possible to install a daemon that monitors which processes access which files, but i think you'll agree that the project is getting quickly out of hand.
thankfully, most devs make sure that their files are clearly recognizable, usually by directory (e.g. ~/.config/thunar, or /etc/systemd/).
some are less obvious, like e.g. ~/.config/Trolltech.conf (i just love that file name. norse mythology. it's qt's equivalent of ~/.gtkrc-2.0).
are there any files in particular that you're interested in?
Offline
The name is usually the give away
If you find any you can't figure out, try using:
apropos <name of file>
To search the man page database for matches.
While you're at it, have a read of:
man man
info info
man hier
man bootup
etc...
/Moved to Basic Help & Support
Offline
In some cases
ps ax | grep app
does the trick.
Offline
Also useful
dpkg -L <package-name>
Will show you all installed files from given package.
This will include README paths (sometimes useful ) as well.
htop is pretty awesome for viewing process info too
shortcut keys (case sensitive):
"t" - process tree view
"H" - show all user threads
"K" - show kernel threads
Offline
Another tool for tracking down what files a program is accessing is strace.
See this tutorial: http://shallowsky.com/blog/linux/cmdline/strace.html
Last edited by johnraff (2015-11-05 12:34:43)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
If you find any you can't figure out, try using:
apropos <name of file>
i think this only works if that file has its own man page?
but then, many have.
While you're at it, have a read of:
man hier
wow, the forefathers really knew how to save on keystrokes
Offline
Another tool for tracking down what files a program is accessing is strace.
See this tutorial: http://shallowsky.com/blog/linux/cmdline/strace.html
This works, but I'd have to know what program i'm looking for before hand. I was thinking of doing it in reverse. I see a random conf file or something, can 'back track' to see what was it that accessed it last
are there any files in particular that you're interested in?
No, not especially, just some of the .config/* files, the systemd startup services, the login scripts.etc.. more so out of curiosity to see which daemons talk to which configs, especially at bootup.
Also useful
htop is pretty awesome for viewing process info too
shortcut keys (case sensitive):
"t" - process tree view
"H" - show all user threads
"K" - show kernel threads
True, I actually installed htop the other day, the process tree feature may be useful I'll check it out!
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
see which daemons talk to which configs, especially at bootup.
Read systemd(1)
Recursively.
Offline
I see a random conf file or something, can 'back track' to see what was it that accessed it last
That sounds quite difficult, but I think you can identify processes that are currently accessing a certain file, device or directory. ohnonot has already mentioned lsof and another one is fuser. I haven't used either of them extensively, but I have a couple of notes stored away from some blog or forum, different context but just pasting in here as-is in case it's any help:
You are probably all too familiar with the situation - you are trying to unmount a drive,
but keep getting told by your system that it's busy.
But what application is tying it up? A quick one-liner will tell you:lsof +D /mnt/windows
This will return the command and process ID of any tasks currently accessing the /mnt/windows directory.
You can then locate them, or use the kill command to finish them off.
-----------------------------------------------------------------
umount: /media/disk: device is busyFirst thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way.
You can use the fuser command to find out which process was keeping the device busy:# fuser -m /dev/sdc1
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmboxRhythmbox is the culprit! Close that down and umount the drive. Problem solved!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I see a random conf file or something, can 'back track' to see what was it that accessed it last
i'm pretty sure there's tools for that.
they are usually designed with server administration in mind.
it will require to have them constantly running in the background. i don't know how extensively they log - usually the stress is on network activity - but i guess they could be configured to provide you with some answers.
Offline