rc dependencies ...

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Sep 16 18:10:22 UTC 2013


On 16/09/2013 09:47, Zeus Panchenko wrote:
> hi,
> 
> please, help me to understand better scripts dependencies, how to make
> one rc script wait for other ...
> 
> for my dhcpd configured with LDAP, I need to start 
> /usr/local/etc/rc.d/isc-dhcpd 
> only after 
> /usr/local/etc/rc.d/slapd
> 
> for what I edited /usr/local/etc/rc.d/isc-dhcpd
> 
> --- isc-dhcpd~  2013-08-31 15:45:32.202899511 +0300
> +++ isc-dhcpd   2013-09-04 18:32:36.297221926 +0300
> @@ -3,7 +3,7 @@
>  # $FreeBSD: branches/RELENG_9_1_0/net/isc-dhcp42-server/files/isc-dhcpd.in 300897 2012-07-14 14:29:18Z beat $
>  #
>  # PROVIDE: dhcpd
> -# REQUIRE: DAEMON
> +# REQUIRE: DAEMON slapd
>  # BEFORE: LOGIN
>  # KEYWORD: shutdown
>  #
> 
> but after reboot, dhcpd still complains:
> Sep 16 10:02:41 bo20 dhcpd: Error: Cannot start TLS session to foo.bar:389: Can't contact LDAP server
> 
> when launched by hands, /usr/local/etc/rc.d/isc-dhcpd starts normally
> 
> 
> so, where is my mistake, why is it not waiting for /usr/local/etc/rc.d/slapd ?
> 

You can force one daemon to start after another one without editing any
of the existing RC scripts (likely to get blown away when you update
that package) by adding an additional RC script like so:

#!/bin/sh
#
# Make isc-dhcpd start after slapd

# PROVIDE: precedence
# REQUIRE: slapd
# BEFORE: isc-dhcpd

Test the resulting startup order by:

  rcorder /etc/rc.d/* /usr/local/etc/rc.d/*

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew at infracaninophile.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 268 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20130916/4c3990ca/attachment.sig>


More information about the freebsd-rc mailing list