Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenRC falsely reports redsocks as crashed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kaizushi
n00b
n00b


Joined: 22 Sep 2018
Posts: 70

PostPosted: Thu Jul 07, 2022 5:55 am    Post subject: OpenRC falsely reports redsocks as crashed Reply with quote

I am having issues with one of my systems which uses redsocks which is a transparent proxy for SOCKS.

It is reporting that redsocks has crashed when it has not and indeed works...

Code:

# rc-service redsocks status
 * status: crashed


But the process is running...
Code:

# ps aux | grep redsocks | grep -v grep
redsocks  427  0.0  0.0   2868   120 ?        Ss   05:46   0:00 /usr/sbin/redsocks -c /etc/redsocks.conf


I also tested it with curl and it indeed works as intended.

This might be worthy of a bug report but I thought the issue might be with my system.

I would like some pointers on diagnosing the issues. How does it check if a service has crashed and what might go wrong?
_________________
I cook a delicious onion stew without any chili peppers.
Back to top
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 297

PostPosted: Thu Jul 07, 2022 12:34 pm    Post subject: Reply with quote

What is the content of /run/redsocks/redsocks.pid?
Does it match the daemon PID?

I'm looking at the initscript to figure out what OpenRC does:
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-proxy/redsocks/files/redsocks.init-r2
Back to top
View user's profile Send private message
kaizushi
n00b
n00b


Joined: 22 Sep 2018
Posts: 70

PostPosted: Wed Jul 13, 2022 1:51 pm    Post subject: Reply with quote

It seems that the pidfile does not exist...

Code:

# ls -l /run/redsocks/redsocks.pid
ls: cannot access '/run/redsocks/redsocks.pid': No such file or directory

_________________
I cook a delicious onion stew without any chili peppers.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1660

PostPosted: Wed Jul 13, 2022 2:01 pm    Post subject: Reply with quote

kaizushi wrote:
It seems that the pidfile does not exist...

Code:

# ls -l /run/redsocks/redsocks.pid
ls: cannot access '/run/redsocks/redsocks.pid': No such file or directory


Using the linked init script as a basis:
The default "mode" of OpenRC is to use start-stop-daemon. This particular daemon looks to be able to background itself and write a pidfile with -p.
Since the special variable pidfile is set, OpenRC expects to find this file to track if the daemon is alive or not.

So if the pidfile is missing, either deleted or not created by the daemon, it will report "crashed" with rc-status since it cannot detect otherwise.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum