Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76278 - conf.d SHAREDIR is actually working dir
Summary: conf.d SHAREDIR is actually working dir
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-31 19:30 UTC by Hunter Cook
Modified: 2005-09-16 16:38 UTC (History)
0 users

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


Attachments
init.d/gift (gift,819 bytes, text/plain)
2005-07-12 11:39 UTC, Marcin Kryczek (RETIRED)
Details
conf.d/gift (gift,641 bytes, text/plain)
2005-07-12 11:40 UTC, Marcin Kryczek (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hunter Cook 2004-12-31 19:30:33 UTC
The value in SHAREDIR is passed to the giftd argument --local-dir=  ...which has nothing to do with the share directory. In particular, this is the directory where giftd will look for the config file.

The problems caused by this are compounded by the fact that the current x86 version (0.11.6-r1) misreports the location of the config as (null). So, if SHAREDIR is set to a directory which does not contain a config, the user has no clues as to the cause of the problem.

The easiest way to deal with this is to rename the variable to something like "CONFDIR" or "WORKINGDIR." The share directory is actually configured in giftd.conf, so it won't hurt anything there.

Reproducible: Always
Steps to Reproduce:
1. Install gift
2. Change the variable SHAREDIR in /etc/conf.d/gift to a directory that contains no giftd.conf file
3. Attempt to start gift with `/etc/init.d/gift start`

Actual Results:  
The startup script reported [ok] but the process died; trying to stop it failed
and I had to use zap. The log message says to run gift-setup, but this program
makes a configuration file somewhere else, so even after running it the same log
message comes up. Worse, the log message says "consult the configuration in
(null)..." so you can't figure out where it's looking.


If the x86 version upgrades to 0.11.8.1 (the current ~x86 version) this is a lot
less difficult to figure out as a user; the (null) bug was fixed in between, so
you can make the connection between SHAREDIR and the conf location. In my case,
I upgraded to 0.11.8.1, saw the new log, and just copied the conf over to the
sharedir. Things worked.

Basically, the point here is that SHAREDIR is a complete misnomer and should be
changed. The only function of that variable the way this application is setup is
the config file location. The name of the variable ought to reflect that, or
there should at least be a comment somewhere nearby to let everyone know.
Comment 1 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-12 11:38:46 UTC
ok. here's my proposition how to solve that:
we should change:
    einfo "First, you need to run gift-setup with your normal"
    einfo "user account to create the giFT configuration files."

into:
    einfo "Configure gift in /usr/share/giFT/ or run gift-setup"
    einfo "as normal user and make:"
    einfo 'cp -R $HOME/.giFT/* /usr/share/giFT/'
    einfo "chown -R p2p:root /usr/share/giFT/*"
    einfo "(be carefull while specyfing directories in gift-setup;"
    einfo "keep in mind that giFT will run as process of user "
    einfo 'specified in /etc/conf.d/gift with his $HOME directory)'

or something similar in all gift's ebuilds (it's not true in fact, that problem 
with (null) is solved in 0.11.8 - it's just hidden, but appears in some 
situations)

SHAREDIR isn't in fact the best name for variable we're talking about. i propose 
LODAL_DIR as it's named like this in giftd options.
additionaly i changed a bit startup script and made it fail if gift won't start 
(also renice proces was bit ugly - start-stop-deamon can do that).
attaching gift.confd and gift.initd
Comment 2 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-12 11:39:39 UTC
Created attachment 63256 [details]
init.d/gift
Comment 3 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-12 11:40:27 UTC
Created attachment 63257 [details]
conf.d/gift
Comment 4 Karol Wojtaszek (RETIRED) gentoo-dev 2005-07-22 09:58:19 UTC
Ebuils are ready to add to portage, i've tested them, but mzholzer is its maintainer
Comment 5 Marcin Kryczek (RETIRED) gentoo-dev 2005-09-16 16:38:55 UTC
this bug is open to long without mholzer's feedback. i'm commiting changes to 
cvs and closing it.