summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-10-25 15:28:15 +0200
committerSimon Rettberg2019-10-25 15:28:15 +0200
commit41757e9acf184629b76ff88016e5ec37633e5e93 (patch)
treed43d181b413ebe8729249b54473d111b164f1d85
parent[SSPS] Prepare for stage4 via DNBD3 (diff)
downloadsetup-scripts-41757e9acf184629b76ff88016e5ec37633e5e93.tar.gz
setup-scripts-41757e9acf184629b76ff88016e5ec37633e5e93.tar.xz
setup-scripts-41757e9acf184629b76ff88016e5ec37633e5e93.zip
[SSPS] Fix check for rc-local; bail out on error; remove systemd check
-rw-r--r--satellit_installer/includes/10-script_dropper.inc42
1 files changed, 20 insertions, 22 deletions
diff --git a/satellit_installer/includes/10-script_dropper.inc b/satellit_installer/includes/10-script_dropper.inc
index e9802ea..512b4cf 100644
--- a/satellit_installer/includes/10-script_dropper.inc
+++ b/satellit_installer/includes/10-script_dropper.inc
@@ -18,7 +18,7 @@ drop_script() {
}
drop_keychanger_rclocal() {
- if grep -q "Deleting old ssh keys" /etc/rc.local; then
+ if grep -q -F "/root/installer/rclocal_script.sh" /etc/rc.local; then
echo "# ssh key changer already in rc.local; doing nothing."
else
echo
@@ -26,34 +26,32 @@ drop_keychanger_rclocal() {
cp -p /etc/rc.local /etc/rc.local.sik
cat > /etc/rc.local <<-HIERDOK
#!/bin/bash
- echo "rc.local started: $(date "+%Y-%m-%d %H:%m:%S")" >> /root/init.log
+ echo "rc.local created: $(date "+%Y-%m-%d %H:%m:%S")" >> /root/init.log
echo "Starting /root/installer/rclocal_script.sh..." >> /root/init.log
/root/installer/rclocal_script.sh
exit 0
HIERDOK
chmod +x /etc/rc.local
fi
- if [ "$SYSTEMD" ]; then
- cat > /etc/systemd/system/rc-local.service <<-DORTDOK
- [Unit]
- Description=/etc/rc.local Compatibility
- ConditionFileIsExecutable=/etc/rc.local
- After=network.target mysql.service
-
- [Service]
- Type=forking
- ExecStart=/etc/rc.local start
- TimeoutSec=0
- RemainAfterExit=yes
- SysVStartPriority=99
-
- [Install]
- WantedBy=multi-user.target
- DORTDOK
+ cat > /etc/systemd/system/rc-local.service <<-DORTDOK
+ [Unit]
+ Description=/etc/rc.local Compatibility
+ ConditionFileIsExecutable=/etc/rc.local
+ After=network.target mysql.service
+
+ [Service]
+ Type=forking
+ ExecStart=/etc/rc.local start
+ TimeoutSec=0
+ RemainAfterExit=yes
+ SysVStartPriority=99
+
+ [Install]
+ WantedBy=multi-user.target
+ DORTDOK
- systemctl reenable rc-local >/dev/null
- [ $? -ne 0 ] && echo "Warning - could not enable systemd service rc-local!"
- fi
+ systemctl daemon-reload
+ systemctl reenable rc-local || perror "Could not enable systemd service rc-local!"
}
drop_firstrun_script () {