Opened 15 years ago

Closed 15 years ago

#5505 closed defect (fixed)

BUG: dhcp 3.0.2 port is compiled with wrong default directories

Reported by: bugzilla.opendarwin.org@… Owned by: cms@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc: mww@…, markd@…
Port:

Description

${prefix}/local/sbin/dhcpd is looking for /etc/dhcpd.conf and /var/db/dhcpd.leases files instead of the equivalents under ${prefix}

Attachments (1)

Portfile.diff (1.3 KB) - added by markd@… 15 years ago.
Portfile diff

Download all attachments as: .zip

Change History (18)

comment:1 Changed 15 years ago by mww@…

Resolution: fixed
Status: newclosed

now the paths are no more hardcoded to /opt/local and also the var/run and etc directories are now being configured to be inside $prefix;

comment:2 Changed 15 years ago by bugzilla.opendarwin.org@…

Resolution: fixed
Status: closedreopened

with a default install, dhcpd 3.0.3 is still defaulting to reading /etc/dhcpd.conf and writing /private/var/db/dhcpd.leases :(

comment:3 Changed 15 years ago by bugzilla.opendarwin.org@…

Owner: changed from cms@… to mww@…
Status: reopenednew

comment:4 Changed 15 years ago by bugzilla.opendarwin.org@…

same goes for /var/run/dhcpd.pid

comment:5 Changed 15 years ago by mww@…

Cc: mww@… added
Owner: changed from mww@… to cms@…
Summary: dhcp 3.0.2 port is compiled with wrong default directoriesBUG: dhcp 3.0.2 port is compiled with wrong default directories

comment:6 Changed 15 years ago by markd@…

(In reply to comment #3)

same goes for /var/run/dhcpd.pid

It look to me like no conf or lease file locations are being set so dhcpd is probably just defaulting to those paths. There are dhcpd startup switches:

[-cf config-file] [-lf lease-file]

So what if you change startupitem.start from

"\[ -x ${prefix}/sbin/dhcpd \] && ${prefix}/sbin/dhcpd"

to

"\[ -x ${prefix}/sbin/dhcpd \] && ${prefix}/sbin/dhcpd -cf ${etc}/dhcpd.conf -lf ${prefix}/var/db/dhcpd/dhcpd.leases"

I'm not sure about the pid issue. I've let some ports put pid files in /var/run when it didn't seem like getting them in ${prefix} was going to be easy, even though it breaks DP convention. It seems of lesser importance at least to me.

comment:7 Changed 15 years ago by bugzilla.opendarwin.org@…

(In reply to comment #4)

It look to me like no conf or lease file locations are being set so dhcpd is probably just defaulting to those paths.

righto. the question is whether or not the default can be changed at compile time :)

marc

comment:8 Changed 15 years ago by markd@…

Cc: markd@… added

(In reply to comment #5)

(In reply to comment #4)

It look to me like no conf or lease file locations are being set so dhcpd is probably just defaulting to those paths.

righto. the question is whether or not the default can be changed at compile time :)

The path isn't compiled into the dhcp app but I think you mean "compiled" into the port, since all you want is for it to use the right paths after the port install. Yes that can be done and I've got a fix now. I'm just waiting on an answer to one startupitem usage question to the DP list before I post it here. If the maintainer is awol, likely so since he hasn't responded to the bug report, I or someone will have to commit it. So it should be fixed within a few days so you can test it.

Mark

comment:9 Changed 15 years ago by markd@…

Marc,

By the way, how do you start and stop dhcpd when you make configuration changes? Do you use Unix commands such as 'kill', or is there a script somewhere? Though I don't use the app, I suppose that starting/stopping dhcp on the fly without rebooting might be important. It looked to me like ISC did not provide a script to do that so I created one but maybe there is something about it I don't know.

Mark

comment:10 Changed 15 years ago by bugzilla.opendarwin.org@…

(In reply to comment #6)

The path isn't compiled into the dhcp app

sure it is. where else do you think it gets the default from when you don't specify it on the command line? ;)

all you want is for it to use the right paths after the port install.

i want it to default to the correct defaults.

If the maintainer is awol, likely so since he hasn't responded to the bug report, I or someone will have to commit it.

mww did the last remake of this port. you may want to run any changes by him.

(In reply to comment #7)

By the way, how do you start and stop dhcpd when you make configuration changes? Do you use Unix commands such as 'kill', or is there a script somewhere?

bug 5506 converted this port to the modern startup-items dports framework. so for now, you can use "/Library/StartupItems/dhcpd/dhcpd stop", e.g. once startup-items groks luanchd, you should be able to use launchtl.

I suppose that starting/stopping dhcp on the fly without rebooting might be important.

most def :)

comment:11 Changed 15 years ago by markd@…

(In reply to comment #8)

(In reply to comment #6)

The path isn't compiled into the dhcp app

sure it is. where else do you think it gets the default from when you don't specify it on the command line? ;)

Right. I only meant that ISC does not intend people to change the defaults by changing the compiled setting since they don't provide configure switches for that, rather they have provided a better way with startup switches.

If the maintainer is awol, likely so since he hasn't responded to the bug report, I or someone will have to commit it.

mww did the last remake of this port. you may want to run any changes by him.

I'll run it by Marcus. But if the listed maintainer is gone then we should probably change the maintainer to the generic darwinports address unless someone else wants to do it. I don't use it so I'd rather not.

(In reply to comment #7)

By the way, how do you start and stop dhcpd when you make configuration changes? Do you use Unix commands such as 'kill', or is there a script somewhere?

bug 5506 converted this port to the modern startup-items dports framework. so for now, you can use "/Library/StartupItems/dhcpd/dhcpd stop", e.g. once startup-items groks luanchd, you should be able to use launchtl.

I suppose that starting/stopping dhcp on the fly without rebooting might be important.

most def :)

I'm new to launchd and systemstarter. As long as you can start/stop it easily without rebooting then the startupitem switches are all that it needs. I just wanted to be sure. I'm submitting a patch for Marcus to look over.

Mark

comment:12 Changed 15 years ago by markd@…

I've attached a proposed revision to the Portfile. I just added startupitem switches to locate .conf and lease files and added ui_msg's alerting user of file locations.

I don't know of a way to force dhcpd to put it's PID in ${prefix} so I just changed the startupitem to point to /var/run.

I also changed the etc path from etc/dhcp to etc/dhcpd. Isn't that more correct and less confusing? If anyone knows better then just change it back or tell me and I'll change the patch.

Mark

Changed 15 years ago by markd@…

Attachment: Portfile.diff added

Portfile diff

comment:13 Changed 15 years ago by mww@…

well, I'd say this is a timeout - go ahead and commit the patch (looks quite good) and inc. the revision!

comment:14 Changed 15 years ago by bugzilla.opendarwin.org@…

i see what you mean about ISC not intending that path to be changed.

thanks, mark!

comment:15 Changed 15 years ago by markd@…

Ok, I committed it with a revision #1 so within a few hours you should see version 3.0.3_1 after doing a "port selfupdate". I also decided the original etc location -${prefix}/etc/dhcp- was better since there is a client with the package also and the port is named dhcp, even though the var directory is "dhcpd". I suppose that is the most logical way after all.

So please test this and report.

comment:16 Changed 15 years ago by markd@…

Well it seems fine to me so I'd say this bug can be closed.

comment:17 Changed 15 years ago by blb@…

Resolution: fixed
Status: newclosed

Resolving per markd@'s comment.

Note: See TracTickets for help on using tickets.