Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Mar 2011 21:09:40 +0100
From:      Hilko Meyer <Hilko.Meyer@gmx.de>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        freebsd-stable@freebsd.org, Miroslav Lachman <000.fbsd@quip.cz>
Subject:   Re: service(8) doesn't list dhcpd startscript
Message-ID:  <u1k7n6lpp2r84aunh3bkb4ll3s4fl9k4e6@mail.gmx.net>
In-Reply-To: <4D72A3CD.2070904@FreeBSD.org>
References:  <6v82n6934o8p7u4vpbde35dbnc41mjd4a5@4ax.com> <4D716CEE.7040106@quip.cz> <4D72A3CD.2070904@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Doug Barton schrieb:
>On 03/04/2011 14:51, Miroslav Lachman wrote:
>> Hilko Meyer wrote:
>>>
>>> today I played a bit with service(8) and I noticed that it doesn't
>>> properly
>>> detects the isc-dhcpd-startscript. System is 7.3-RELEASE-p4. 'service
>>> -l' lists
>>> isc-dhcpd but 'service -e' doesn't lists it:
>>> | hilti@kirk:~> service -l | grep dhcp
>>> | isc-dhcpd
>>> | hilti@kirk:~> service -e | grep dhcp
>>> | hilti@kirk:~> /usr/local/etc/rc.d/isc-dhcpd rcvar
>>> | # dhcpd
>>> | dhcpd_enable=3DYES
>>
>> It works for me on newer version of the FreeBSD (7.4-RELEASE) and with
>> newer dhcpd (isc-dhcp41-server-4.1.2_2,1)
>>
>> ~/# service -l | grep dhcp
>> isc-dhcpd
>> isc-dhcpd6
>>
>> ~/# service -e | grep dhcp
>> /usr/local/etc/rc.d/isc-dhcpd
>> /usr/local/etc/rc.d/isc-dhcpd6
>>
>> ~/# /usr/local/etc/rc.d/isc-dhcpd rcvar
>> # dhcpd
>> dhcpd_enable=3DYES
>>
>> So you can compare rc scripts for those two versions or compare =
changes
>> in service between these two FreeBSD releases.
>
>I'm glad to hear that Miroslav was able to make it work. I looked at the=
=20
>code and it's pretty simple, so I'm not sure why it would fail.
>
>Hilko, if you can add -x to the end of the #!/bin/sh line in=20
>/usr/sbin/service it might give you more of an idea of what's going on.

Thanks for the hint. I think I found something:

hilti@kirk:~/dhcpd> script log  sh -x /usr/sbin/service -e
[snip]
+ grep -q ^rcvar /etc/rc.d/yppasswdd
+ grep ^name=3D /etc/rc.d/yppasswdd
+ eval name=3D"yppasswdd"
+ name=3Dyppasswdd
+ grep ^rcvar /etc/rc.d/yppasswdd
+ eval rcvar=3D"nis_yppasswdd_enable"
+ rcvar=3Dnis_yppasswdd_enable
+ checkyesno nis_yppasswdd_enable
+ grep -q ^rcvar /usr/local/etc/rc.d/isc-dhcpd
+ grep ^name=3D /usr/local/etc/rc.d/isc-dhcpd
+ eval name=3Ddhcpd
+ name=3Ddhcpd
+ grep ^rcvar /usr/local/etc/rc.d/isc-dhcpd
+ eval rcvar_chuser () rcvar_jail () rcvar_chroot () rcvar_pidnleases ()
rcvar_rooted () rcvar=3D${name}_enable
+ checkyesno nis_yppasswdd_enable

Seems 'grep ^rcvar /usr/local/etc/rc.d/isc-dhcpd' finds more than
expected. I added a '=3D' in /usr/sbin/service and changed the line to
eval `grep ^rcvar=3D $file`. Now it works like expected.

But there is stil one question. Why it works in 7.4-RELEASE with newer
dhcpd?=20
| hilti@kirk:~/dhcpd> grep ^rcvar isc-dhcpd_*
| isc-dhcpd_3.1.in:rcvar_chuser ()
| isc-dhcpd_3.1.in:rcvar_jail ()
| isc-dhcpd_3.1.in:rcvar_chroot ()
| isc-dhcpd_3.1.in:rcvar_pidnleases ()
| isc-dhcpd_3.1.in:rcvar_rooted ()
| isc-dhcpd_3.1.in:rcvar=3D${name}_enable
| isc-dhcpd_4.1.in:rcvar_chuser ()
| isc-dhcpd_4.1.in:rcvar_chroot ()
| isc-dhcpd_4.1.in:rcvar_pidnleases ()
| isc-dhcpd_4.1.in:rcvar_rooted ()
| isc-dhcpd_4.1.in:rcvar=3D${name}_enable
In both files more than one result. And there was no change in
service(8) between 7.3 and 74. Strange...

Hilko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?u1k7n6lpp2r84aunh3bkb4ll3s4fl9k4e6>