Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2016 15:30:40 +0200
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Zeus Panchenko <zeus@ibs.dn.ua>, freebsd-rc@freebsd.org
Subject:   Re: how to start sshd just after network initialization? ...
Message-ID:  <57BAFE80.3050501@quip.cz>
In-Reply-To: <20160822160651.88181@relay.ibs.dn.ua>
References:  <20160822160651.88181@relay.ibs.dn.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Zeus Panchenko wrote on 08/22/2016 15:06:
> hi,
>
> what is the best way to guarantee scripts starting order?
>
> I need sshd start first and squid start last among all scripts which are starting
>
> is the only way to put (for example) to /usr/local/etc/rc.d/ script/s
> to order it?
>
> so, to just start squid after sshd I need something like this:
>
> ---[ /usr/local/etc/rc.d/ORDER1 start ]---
>
> #!/bin/sh
> #
>
> # PROVIDE: precedence
> # REQUIRE: sshd
> # BEFORE: squid
>
> ---[ /usr/local/etc/rc.d/ORDER1 stop  ]---
>
>
> but how to configure it globally to start sshd just after network initialization?
> is it something like this?
>
> ---[ /usr/local/etc/rc.d/ORDER0 start ]---
>
> #!/bin/sh
> #
>
> # PROVIDE: precedence
> # REQUIRE: NETWORKING pf pflog
> # BEFORE: sshd
>
> ---[ /usr/local/etc/rc.d/ORDER0 stop  ]---
>
> is there some other way to order them?

I had similar requirements so I had this

/usr/local/etc/rc.d/sshd_reorder

#!/bin/sh

# PROVIDE: sshd_reorder
# REQUIRE: LOGIN sshd

## this file is just to start sshd earlier on the boot
## mainly before long starting processes like jails, mysql, apache etc.
##
## place this file in to /usr/local/etc/rc.d/sshd_reorder
## and make it executable chmod 0555 /usr/local/etc/rc.d/sshd_reorder


I don't know when Squid starts (I don't use it) so you can look in to 
output of rcorder /etc/rc.d/* /usr/local/etc/rc.d/* and use NETWORKING 
alone or some more specific

Miroslav Lachman



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