Bug 204558 - www/uwsgi: rc script fails with non-default Python
Summary: www/uwsgi: rc script fails with non-default Python
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-15 15:45 UTC by John W. O'Brien
Modified: 2015-11-16 19:43 UTC (History)
2 users (show)

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


Attachments
www/uwsgi: Accept configurable uwsgi executable command in rc script (1.79 KB, patch)
2015-11-15 15:58 UTC, John W. O'Brien
john: maintainer-approval? (demon)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John W. O'Brien 2015-11-15 15:45:40 UTC
Following the addition of USE_PYTHON=concurrent (r400449), if www/uwsgi is built against a non-default python, the rc script fails to start the daemon.

For example:

    DEFAULT_VERSIONS= python=2.7 python2=2.7 python3=3.4
    PYTHON_VERSION= python3.4

    % pkg info -xl uwsgi | grep bin
        /usr/local/bin/uwsgi-3.4
    % grep bin /usr/local/etc/rc.d/uwsgi
    #!/bin/sh
    command=/usr/local/bin/uwsgi
    command=/usr/local/bin/uwsgi
    % sudo service uwsgi start
    Processing uwsgi profile: foo
    /usr/local/etc/rc.d/uwsgi: WARNING: run_rc_command: cannot run /usr/local/bin/uwsgi

I believe the best solution would be to teach the rc script to understand setting the uwsgi command on a per-profile basis.
Comment 1 John W. O'Brien 2015-11-15 15:58:44 UTC
Created attachment 163137 [details]
www/uwsgi: Accept configurable uwsgi executable command in rc script

This is not yet tested, but should show what I have in mind. Also, I now realize that I don't know how USE_PYTHON=concurrent is supposed to handle the apparently-conflicting rc script itself.
Comment 2 Dmitry Sivachenko freebsd_committer freebsd_triage 2015-11-15 16:13:42 UTC
I wonder if it is a real-world use case when you need 2 versions of uwsgi (for python2 and python3) installed at the same time?

If it is just a theoretical assumption, I'd prefer to just remove "concurrent" and stop making port more complicated without a reason.
Comment 3 John W. O'Brien 2015-11-15 22:36:36 UTC
@demon: It seems to me that the use case is just as real for uwsgi as it is for any python-based port, and more real than many because uwsgi is expressly designed to host multiple concurrent apps though rc profiles. However, I recognize the difficulty in implementing this since the "concurrent" machinery does not extend to the rc script and uwsgi is evidently in a vanishingly small minority in benefitting from such an arrangement. It's probably best to resolve this by removing the broken support for concurrent installations, and perhaps to revisit it when circumstances change.
Comment 4 Dmitry Sivachenko freebsd_committer freebsd_triage 2015-11-16 10:52:28 UTC
@koobs: what do you think if I remove "concurrent" for now?
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2015-11-16 16:32:14 UTC
(In reply to Dmitry Sivachenko from comment #4)

No objections, but if there's an quick/easy win we can make in improving concurrent support, that would be nice so all ports can benefit. We need good use-cases like this to test it.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-11-16 19:39:23 UTC
A commit references this bug:

Author: demon
Date: Mon Nov 16 19:38:40 UTC 2015
New revision: 401784
URL: https://svnweb.freebsd.org/changeset/ports/401784

Log:
  Revert "concurrent" for now, port is not ready for it yet.

  PR:		204558
  Submitted by:	John W. O'Brien <john@saltant.com>
  No objection from:	koobs

Changes:
  head/www/uwsgi/Makefile
Comment 7 Dmitry Sivachenko freebsd_committer freebsd_triage 2015-11-16 19:43:02 UTC
I removed concurrent for now, feel free to come back if there is a demand for it.