Initial commit
[ta/infra-ansible.git] / roles / baremetal_provision / templates / guest-img-nginx.service
1 # Copyright 2019 Nokia
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 [Unit]
16 Description=The nginx HTTP for hosting guest-image.img during ironic node provisioning
17 After=network.target remote-fs.target nss-lookup.target
18
19 [Service]
20 Type=forking
21 PIDFile=/run/guest-img-nginx.pid
22 # Nginx will fail to start if /run/guest-img-nginx.pid already exists but has the wrong
23 # SELinux context. This might happen when running `nginx -t` from the cmdline.
24 # https://bugzilla.redhat.com/show_bug.cgi?id=1268621
25 ExecStartPre=/usr/bin/rm -f /run/guest-img-nginx.pid
26 ExecStartPre=/usr/sbin/nginx -t -c /opt/guest-img-nginx/nginx.conf
27 ExecStart=/usr/sbin/nginx -c /opt/guest-img-nginx/nginx.conf
28 ExecReload=/bin/kill -s HUP $MAINPID
29 KillSignal=SIGQUIT
30 TimeoutStopSec=5
31 KillMode=process
32 #PrivateTmp=true
33
34 [Install]
35 WantedBy=multi-user.target