Re: doing something before everything else

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Ok, great I have an rc-local working but now I have a problem that Jenkins
is starting up before / during the rc-local is running.

Jenkins is shipping with an init script. I want to put a
"Before=jenkins.service" in rc-local but Jenkins doesnt have a service
file....

How can I ensure that rc-local is running before the Jenkins init?

Thanks,

Andrew

On 22 July 2017 at 14:06, Jonathan Billings <billings@xxxxxxxxxx> wrote:

> On Jul 22, 2017, at 8:28 AM, Andrew Holway <andrew.holway@xxxxxxxxx>
> wrote:
> > I want to run a script before systemd starts doing stuff but I cant find
> > anything online about how that could happen. It seems /etc/rc.local is
> > depreciated now?
>
> You can’t run anything before systemd starts, since it is started by the
> kernel before the local filesystems have been mounted.
>
> /etc/rc.d/rc.local still runs, but it is a systemd service run as
> rc-local.service, contingent on /etc/rc.d/rc.local existing and being
> executable.
>
> Now, if you want to run something before systemd starts other services,
> you need to create your own systemd unit, and set up dependencies such that
> the service starts before those services.  For example, you’d put
> "Before=network-pre.target” in the [Unit] section if you wanted your
> service to start before the network was brought up.  For what it’s worth,
> rc-local.service has a dependency that actually starts it *after* the
> network service comes up, so it starts later in the startup anyway.
>
>
> --
> Jonathan Billings <billings@xxxxxxxxxx>
>
>
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> https://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux