Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 674658 - net-vpn/tor - /etc/init.d/tor should show what is actually wrong with config on checkconfig
Summary: net-vpn/tor - /etc/init.d/tor should show what is actually wrong with config ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: John Helmert III
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-01-06 09:43 UTC by 3uklz9+cwyw433xfnykw
Modified: 2023-08-31 05:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Change tor init script not redirect tor check config output to /dev/null (0001-Do-not-swallow-tor-checkconfig-output.patch,873 bytes, patch)
2023-08-30 14:51 UTC, Dániel Varga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description 3uklz9+cwyw433xfnykw 2019-01-06 09:43:55 UTC
Currently /etc/init.d/tor checkconfig only says that config is invalid, and hides what the problem is into /dev/null. It would be much easier to fix the problem if the user can see what is wrong. I suggest the following enhancement to /etc/init.d/tor:

checkconfig() {
        problems="$(${command} --verify-config --hush)"
        if [ $? -ne 0 ] ; then
                eerror "Tor configuration (/etc/tor/torrc) is not valid."
                eerror "Example is in /etc/tor/torrc.sample"
                eerror "$problems"
                return 1
        fi
}
Comment 1 Anthony Basile gentoo-dev 2019-01-06 16:59:41 UTC
(In reply to 3uklz9+cwyw433xfnykw from comment #0)
> Currently /etc/init.d/tor checkconfig only says that config is invalid, and
> hides what the problem is into /dev/null. It would be much easier to fix the
> problem if the user can see what is wrong. I suggest the following
> enhancement to /etc/init.d/tor:
> 
> checkconfig() {
>         problems="$(${command} --verify-config --hush)"
>         if [ $? -ne 0 ] ; then
>                 eerror "Tor configuration (/etc/tor/torrc) is not valid."
>                 eerror "Example is in /etc/tor/torrc.sample"
>                 eerror "$problems"
>                 return 1
>         fi
> }

looks good to me.  do you want to prepare a patch with your name as the author so i can properly attribute it to you.  if you feel comforatable, use github.
Comment 2 3uklz9+cwyw433xfnykw 2019-02-09 10:06:16 UTC
I'd love to but current GLEP 76: Copyright Policy requires real name for commits and I cannot provide that. :-(

I can make a patch file, but is it of any use from anonymous donor?

Or should anonymous entities just point out bugs without suggesting fixes?
Comment 3 Dániel Varga 2023-08-30 14:51:47 UTC
Created attachment 869062 [details, diff]
Change tor init script not redirect tor check config output to /dev/null

I run into this issue myself. I think it should be okay not to redirect the output to null, as it's done for other daemons. I tested this change myself, it only writes to output if there was an error in the configuration. Please see attached patch.