LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-01-2023, 04:39 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Rep: Reputation: 10
Post Process and configuration files


Hello,
I have run Tor with two configuration files and when I check the processes I see two Tor processes:
Code:
# ps -A
    PID TTY          TIME CMD
 261608 ?        00:00:32 tor
 271881 ?        01:07:30 tor
How can I find out which configuration file each of these processes belongs to?

Thank you.
 
Old 11-01-2023, 04:58 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,852

Rep: Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310
probably lsof -p <pid>, or check /proc/<pid>/
 
Old 11-01-2023, 05:35 AM   #3
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by pan64 View Post
probably lsof -p <pid>, or check /proc/<pid>/
Hello,
Thank you so much for your reply.
In the output of the lsof -p <pid> command, I didn't see anything about the configuration file, but from the /var/lib/tor_OpenVPN/lock line in the output, I was able to identify which configuration file this process belongs to, because I had put the DataDirectory /var/lib/tor_OpenVPN line in the Tor configuration file.

As for the proc directory, which file should I check?
Code:
# cat /proc/261608/
arch_status         cpuset              limits              numa_maps           schedstat           task/
attr/               cwd/                loginuid            oom_adj             sessionid           timens_offsets
autogroup           environ             map_files/          oom_score           setgroups           timers
auxv                exe                 maps                oom_score_adj       smaps               timerslack_ns
cgroup              fd/                 mem                 pagemap             smaps_rollup        uid_map
clear_refs          fdinfo/             mountinfo           patch_state         stack               wchan
cmdline             gid_map             mounts              personality         stat                
comm                io                  mountstats          projid_map          statm               
coredump_filter     ksm_merging_pages   net/                root/               status              
cpu_resctrl_groups  ksm_stat            ns/                 sched               syscall
 
Old 11-01-2023, 11:51 AM   #4
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
If you used the "-f" option to specify the conf file, it will show on the command line under 'cmdline" file of that process.
 
Old 11-14-2023, 11:32 PM   #5
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by jayjwa View Post
If you used the "-f" option to specify the conf file, it will show on the command line under 'cmdline" file of that process.
Hello,
Thank you so much for your reply.
Where should I use -f?
 
Old 11-15-2023, 11:56 AM   #6
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
Code:
tor -f /etc/other/torrc
If you run Tor without setting the config file, it will grab /etc/tor/torrc. Seems like both your instances will grab that default value. I'm not sure how you have two running off the same config as they'd try to access/bind the same port. Is there a special reason you are using two instances? You can set multiple hidden services with one file.
 
1 members found this post helpful.
Old 11-21-2023, 11:31 PM   #7
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by jayjwa View Post
Code:
tor -f /etc/other/torrc
If you run Tor without setting the config file, it will grab /etc/tor/torrc. Seems like both your instances will grab that default value. I'm not sure how you have two running off the same config as they'd try to access/bind the same port. Is there a special reason you are using two instances? You can set multiple hidden services with one file.
Hello,
Thank you so much for your reply.
Yes, I have used -f. I want to merge Tor with OpenVPN and have a Tor proxy also.
 
Old 01-20-2024, 02:35 PM   #8
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Original Poster
Rep: Reputation: 10
Hello,
The ps aux | grep tor command, gave me some useful information.

Thank you.
 
  


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
API for current running process details like process name, process id, amount of memory used anki123 Linux - General 1 01-20-2019 02:06 AM
System wide configuration parameters in configuration files (/etc, e.g.) Kromitvs Linux - Newbie 15 06-06-2013 05:11 PM
[SOLVED] Equivalent files in Arch configuration of services to Debian configuration... Alexvader Debian 2 10-17-2011 07:44 AM
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:20 AM.

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