Introducing systemd mfg.service
This commit is contained in:
parent
5adc1b90ef
commit
7e9d5f0586
4 changed files with 25 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
bootflag='/.manufactured'
|
||||||
groot='/opt/coins-demo'
|
groot='/opt/coins-demo'
|
||||||
|
|
||||||
k8sDemoWA () {
|
k8sDemoWA () {
|
||||||
|
@ -11,5 +12,9 @@ ansible () {
|
||||||
ansible-playbook bootstrap-node.yml && \
|
ansible-playbook bootstrap-node.yml && \
|
||||||
ansible-playbook init-cluster.yml
|
ansible-playbook init-cluster.yml
|
||||||
}
|
}
|
||||||
k8sDemoWA;
|
|
||||||
ansible;
|
if [ ! -f ${bootflag} ]; then
|
||||||
|
touch ${bootflag}
|
||||||
|
k8sDemoWA;
|
||||||
|
ansible;
|
||||||
|
fi
|
||||||
|
|
|
@ -102,7 +102,9 @@ d-i preseed/late_command string in-target /bin/sh -c " \
|
||||||
curl -L https://dl.bintray.com/flant/werf/v1.1.19+fix10/werf-linux-amd64-v1.1.19+fix10 -o /usr/bin/werf ; \
|
curl -L https://dl.bintray.com/flant/werf/v1.1.19+fix10/werf-linux-amd64-v1.1.19+fix10 -o /usr/bin/werf ; \
|
||||||
chmod +x /usr/bin/werf ; \
|
chmod +x /usr/bin/werf ; \
|
||||||
git clone https://git.ix.gs/public/coins-demo.git /opt/coins-demo ; \
|
git clone https://git.ix.gs/public/coins-demo.git /opt/coins-demo ; \
|
||||||
cp /opt/coins-demo/contrib/rc_local.tpl /etc/rc.local ; \
|
cp /opt/coins-demo/contrib/mfg.service /usr/lib/systemd/system/ ; \
|
||||||
|
systemctl daemon-reload ; \
|
||||||
|
systemctl enable mfg.service ; \
|
||||||
systemctl enable serial-getty@ttyS0.service ; \
|
systemctl enable serial-getty@ttyS0.service ; \
|
||||||
systemctl enable docker.service \
|
systemctl enable docker.service \
|
||||||
|| true"
|
|| true"
|
||||||
|
|
15
contrib/mfg.service
Normal file
15
contrib/mfg.service
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Manufacturing service
|
||||||
|
After=serial-getty@ttyS0.service
|
||||||
|
After=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/opt/coins-demo/contrib/firstboot.sh
|
||||||
|
StandardInput=tty
|
||||||
|
TTYPath=/dev/ttyS0
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
bootflag="/.manufactured"
|
|
||||||
if [ ! -f ${bootflag} ]; then
|
|
||||||
exec /opt/coins-demo/contrib/firstboot.sh
|
|
||||||
touch ${bootflag}
|
|
||||||
fi
|
|
Loading…
Add table
Add a link
Reference in a new issue