Opened 15 years ago

Closed 15 years ago

#20759 closed defect (fixed)

denyhosts port broken (doesn't start)

Reported by: razzfazz (Daniel Becker) Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: denyhosts

Description

It appears the py25-denyhosts port currently does not work correctly, in that it fails to actually start the denyhosts daemon. As far as I can tell, this is for two reasons:

1) The Start() and Stop() functions in @PREFIX@/etc/LaunchDaemons/org.macports.py25-denyhosts/py25-denyhosts.wrapper are broken: start and stop should be on the same line as @PREFIX@/share/denyhosts/daemon-control-dist in both, rather than being on the next line by themselves.

2) As specified in the config file, the daemon writes files to @PREFIX@/var/run and @PREFIX@/var/log; however, the port does not actually create these directories (they did not previously exist on my installation), and thus the daemon aborts with a "cannot open file" error.

After fixing these two issues, it looks like denyhosts works as expected.

Attachments (2)

py25-denyhosts.diff (2.5 KB) - added by nerdling (Jeremy Lavergne) 15 years ago.
planned changes
py25-denyhosts.2.diff (2.2 KB) - added by nerdling (Jeremy Lavergne) 15 years ago.
updated patch to use python variants and macports' startupitem

Download all attachments as: .zip

Change History (17)

comment:1 Changed 15 years ago by nerdling (Jeremy Lavergne)

Owner: changed from macports-tickets@… to snc@…
Status: newassigned

comment:2 Changed 15 years ago by nerdling (Jeremy Lavergne)

daemon-control-dist should never be run from the installation of MacPorts and is there for the user to copy and edit. I'm updating the ui_msg to better indicate this:

    ui_msg "    Please read ${prefix}/share/denyhosts/README.txt"
    ui_msg ""
    ui_msg "    You need to make config files in ${prefix}/share/denyhosts"
    ui_msg "    The files ending with '-dist' are examples for you to copy"
    ui_msg ""
    ui_msg "    A startup item is provided but disabled. to activate it, run"
    ui_msg "      sudo launchtl load -w /Library/LaunchDaemons/denyhosts.plist"

I'm also attaching my own launchd startup script to be used instead of MacPorts generating one. It is disabled by default (activation instructions are in the ui_msg above).

I agree, the default directories should be created. I'm adding code for this.

How does that sound?

Changed 15 years ago by nerdling (Jeremy Lavergne)

Attachment: py25-denyhosts.diff added

planned changes

comment:3 Changed 15 years ago by nerdling (Jeremy Lavergne)

I've moved this from python/py25-denyhosts to security/denyhosts.

Please uninstall py25-denyhosts and do a selfupdate.

comment:4 in reply to:  2 Changed 15 years ago by razzfazz (Daniel Becker)

Replying to snc@…:

I'm also attaching my own launchd startup script to be used instead of MacPorts generating one. It is disabled by default (activation instructions are in the ui_msg above).

I think I liked the MacPorts-generated LaunchDaemon better, as that properly handled stop and restart as well. Looking at other Portfiles, it looks like the problem with the auto-generated LaunchDaemon was that the startupitem.start and startupitem.stop lines weren't quoted properly.

So my suggestion would be to revert to using the auto-generated LaunchDaemon, and restore the startupitem.* entries in the Portfile with the following modifications:

startupitem.start   "${prefix}/share/denyhosts/daemon-control start"
startupitem.stop    "${prefix}/share/denyhosts/daemon-control stop"

(Added quoting, removed -dist.)

Does that sound reasonable?

comment:5 Changed 15 years ago by razzfazz (Daniel Becker)

Also, in case you prefer to keep your own LaunchDaemon, I believe line 11 ought to be changed to use @PREFIX@:

<string>@PREFIX@/share/denyhosts/daemon-control</string>

Furthermore, again going by how other ports do it, I think the actual LaunchDaemon should go in @PREFIX@/etc/LaunchDaemons, with /Library/LaunchDaemons just getting a symlink to it.

Changed 15 years ago by nerdling (Jeremy Lavergne)

Attachment: py25-denyhosts.2.diff added

updated patch to use python variants and macports' startupitem

comment:6 Changed 15 years ago by nerdling (Jeremy Lavergne)

Regarding the attached launchd script: I did a reinplace to fix it in the last patch.

I'm gonna toss it for now (I use it here, though). New patch attached. Does this address your issues completely? I also added python version variants.

comment:7 Changed 15 years ago by razzfazz (Daniel Becker)

Looks good, except I think line 48 should probably be removed now that we're back to using the MacPorts-generated LaunchDaemon. Also, was the removal of the livecheck.name line intentional? I have no idea what that is for, so this might be a stupid question...

comment:8 Changed 15 years ago by nerdling (Jeremy Lavergne)

Yea, line 48 should go. Missed it.

The livecheck.name was for when the name was py25-denyhosts. Hard to do a livecheck with the wrong name ;-)

comment:9 Changed 15 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: assignedclosed

Committed in r55957.

comment:10 in reply to:  3 Changed 15 years ago by razzfazz (Daniel Becker)

Replying to snc@…:

I've moved this from python/py25-denyhosts to security/denyhosts.

Please uninstall py25-denyhosts and do a selfupdate.

So I did sudo port -cuv selfadptue, and while I now see the new files in security/denyhosts, port}} doesn't appear to know about them (but does still know about {{{python/py25-denyhosts -- but of course that no longer exists). Digging around a little, it looks like PortIndex still has pointers to the old state of affairs -- is that a problem on my side (i.e., do I need to do anything in addition to selfupdate), or is PortIndex missing an update in the repository?

comment:11 Changed 15 years ago by nerdling (Jeremy Lavergne)

PortIndex is 30 minutes behind the Portfiles. You can generate your own (in the directory where PortIndex resides, run sudo portindex or update again in 30 minutes.

comment:12 Changed 15 years ago by nerdling (Jeremy Lavergne)

And the PortIndex just ran: r55958.

comment:13 Changed 15 years ago by razzfazz (Daniel Becker)

Still getting this error after selfupdate, clean --all, install:

--->  Building denyhosts
Error: Target org.macports.build returned: can't read "python.bin": no such variable
Warning: the following items did not execute (for denyhosts): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

comment:14 Changed 15 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: closedreopened

comment:15 Changed 15 years ago by nerdling (Jeremy Lavergne)

Port: denyhosts added; py25-denyhosts removed
Resolution: fixed
Status: reopenedclosed
Summary: py25-denyhosts port broken (doesn't start)denyhosts port broken (doesn't start)

The undefined variable is a side effect of the PortGroups being inside variants.

Dropping python25 variant.

Committed in r57279.

Note: See TracTickets for help on using tickets.