Bug 229878 - net/mpich2: Doesn't look for the installed /usr/local/etc/mpd.conf
Summary: net/mpich2: Doesn't look for the installed /usr/local/etc/mpd.conf
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thierry Thomas
Depends on:
Reported: 2018-07-19 00:31 UTC by Yuri Victorovich
Modified: 2019-08-14 15:33 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (thierry)


Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2018-07-19 00:31:04 UTC
mpirun command doesn't find mpd.conf by default:
> printf "Hello worldktrace -di mpirun -np 4 prinf "Hello worldktrace -di mpirun -np 4 ls""
> unable to find mpd.conf file

Based on the ktrace log it only looks for /home/{user}/.mpd.conf and then fails, while the mpd.conf file /usr/local/etc/mpd.conf is installed (with a sample).

Could you please change the behavior and make it look for the installed /usr/local/etc/mpd.conf by default?

Comment 1 Yuri Victorovich freebsd_committer 2018-07-19 00:33:05 UTC
It should either look for /home/{user}/.mpd.conf and /usr/local/etc/mpd.conf, or only for /usr/local/etc/mpd.conf, but not just for /home/{user}/.mpd.conf.
Comment 2 Thierry Thomas freebsd_committer 2018-07-19 17:55:11 UTC
Are you sure?

According to the comments in src/pm/mpd/mpdroot.c:

     * We look for a readable mpd.conf in the following order.
     * - MPD_CONF_FILE set in environment
     * - .mpd.conf in the user's home directory
     * - The system wide default in SYSCONFDIR/mpd.conf
Comment 3 Yuri Victorovich freebsd_committer 2018-07-19 17:58:51 UTC
(In reply to Thierry Thomas from comment #2)

Ok, then it should follow this order, but the last step (SYSCONFDIR/mpd.conf) obviously isn't followed, or SYSCONFDIR is mismatching or not set.
Comment 4 Thierry Thomas freebsd_committer 2018-07-28 15:29:48 UTC
(Sorry for the delay...)

I tested it on 2 different machines, and I cannot see the problem.

Could you please run `make configure' and then attach the file
/usr/ports/net/mpich2/work/mpich2-1.5/src/pm/mpd/Makefile ?

It should contain a line beginning with:
sysconfdir = ${prefix}/etc

Could you please also attach the installed file
/usr/local/bin/mpdlib.py ?

It should contain the lines:
        elif hasattr(os,'getuid')  and  os.getuid() == 0:    # if ROOT
            parmsRCFilename = os.path.abspath('/usr/local/etc/mpd.conf')

Comment 5 Walter Schwarzenfeld freebsd_triage 2019-08-14 15:29:07 UTC
Yuri, is this still relevant?
Comment 6 Yuri Victorovich freebsd_committer 2019-08-14 15:33:27 UTC
(In reply to Walter Schwarzenfeld from comment #5)

I'll retest once I get a chance.