0

we have rhel 7.2 machine

server have the following service

[root@server1 system]# more rc_build_infra.service
[Unit]
Description=infra Manager Server
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=simple
User=infra_bb
Group=mc_group
Environment=JAVA_HOME=/usr/bin/java
ExecStart=/opt/infra_start.sh

[Install]
WantedBy=multi-user.target

now I want to build the a similar service but the new service should be execute after - rc_build_infra.service

what are the configuration that should be in the new service

so new service will execute during machine boot after - rc_build_infra.service

King David
  • 549
  • 6
  • 20

1 Answers1

1

That is simple. You would just use After= in the [Unit] section to declare your desired service order. You can see that your existing unit already does this.

Depending on the nature of the dependencies between your services, you may also need to declare Requires= or BindsTo=. See the documentation for their semantics and you will be able to determine if your scenario requires either of these.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972