summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/rclocal_script.sh
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-18 16:35:30 +0200
committerSimon Rettberg2015-09-18 16:35:30 +0200
commite5e316c0e900968f787ad671db9abecde55d2df6 (patch)
treeb44b1bc746bc5b95924945af5db275245b2b48be /satellit_installer/static_files/rclocal_script.sh
parent[SSPS] Remove obsolete files (diff)
downloadsetup-scripts-e5e316c0e900968f787ad671db9abecde55d2df6.tar.gz
setup-scripts-e5e316c0e900968f787ad671db9abecde55d2df6.tar.xz
setup-scripts-e5e316c0e900968f787ad671db9abecde55d2df6.zip
[SSPS] Introduce upper and lower memory bounds for dmsd memory, move heredocs around
Diffstat (limited to 'satellit_installer/static_files/rclocal_script.sh')
-rw-r--r--satellit_installer/static_files/rclocal_script.sh73
1 files changed, 8 insertions, 65 deletions
diff --git a/satellit_installer/static_files/rclocal_script.sh b/satellit_installer/static_files/rclocal_script.sh
index 758a203..07a69d3 100644
--- a/satellit_installer/static_files/rclocal_script.sh
+++ b/satellit_installer/static_files/rclocal_script.sh
@@ -83,74 +83,17 @@ echo " ok." >> /root/init.log
echo -n "Dienste werden aktiviert..." >> /root/init.log
-if [ $(ps -p 1 -o comm=) = systemd ]; then
- echo "Systemd erkannt (systemctl vorhanden)." >> /root/init.log
- if [ ! -f /etc/systemd/system/dmsd.service ]; then
- cat > /etc/systemd/system/dmsd.service <<-HEREDOC
- [Unit]
- Description=DMSD is the Dozentenmodul server daemon
-
- [Service]
- ExecStartPre=/bin/sh -c "/bin/echo -n 'RAM='>/tmp/dmsd_environment; echo \$(( \$(/usr/bin/free -m | /bin/grep Mem|/usr/bin/tr -s ' '|/usr/bin/cut -f 2 -d ' ') / 3 ))>>/tmp/dmsd_environment"
- EnvironmentFile=-/tmp/dmsd_environment
-
- User=dmsd
- Group=images
- WorkingDirectory=$DMSDDIR
- ExecStart=$(which java) -Xmx\${RAM}M -jar bwLehrpoolSuite_Server.jar
- Restart=always
- RestartSec=5
- SyslogIdentifier=dmsd
- StandardOutput=syslog
- StandardError=syslog
-
- [Install]
- WantedBy=multi-user.target
- HEREDOC
- echo "dmsd.service geschrieben." >> /root/init.log
- fi
- if [ ! -f /etc/systemd/system/taskmanager.service ]; then
- cat > /etc/systemd/system/taskmanager.service <<-SOMEWHEREDOC
- [Unit]
- Description=Taskmanager is a bwLehrpool service daemon
-
- [Service]
- User=taskmanager
- Group=taskmanager
- WorkingDirectory=$TASKMANDIR
- ExecStart=$(which java) -Xmx80M -jar taskmanager.jar
- Restart=always
- RestartSec=5
- SyslogIdentifier=taskmanager
- StandardOutput=syslog
- StandardError=syslog
-
- [Install]
- WantedBy=multi-user.target
- SOMEWHEREDOC
- echo "taskmanager.service geschrieben." >> /root/init.log
- fi
- for i in dmsd.service taskmanager.service; do
- systemctl enable $i
- [ $? -ne 0 ] && echo "Warnung - konnte systemd-Service $i nicht aktivieren!" >> /root/init.log
- done
-else
- # No systemctl -> no systemd, so: inittab-entry dmsd:
- if ! grep -q "dmsd.*respawn" /etc/inittab; then
- echo "dmsd:2:once:$DMSDDIR/dmsd.sh" >> /etc/inittab
- fi
-
- # inittab-entry taskmanager:
- if ! grep -q "tman.*respawn" /etc/inittab; then
- echo "tman:2345:respawn:$TASKMANDIR/taskmanager.sh" >> /etc/inittab
- fi
-fi
+# Enable bwLehrpool related services
+for i in dmsd.service taskmanager.service; do
+ systemctl enable $i
+ [ $? -ne 0 ] && echo "Warnung - konnte systemd-Service $i nicht aktivieren!" >> /root/init.log
+done
echo -n " ok." >> /root/init.log
# Write MOTD
-cat > /etc/motd <<-THEREDOC
- *** bwLehrpool Satelliten-Server, Version $VERSION ***
- Eingerichtet am $(date)
+cat > /etc/motd <<THEREDOC
+ *** bwLehrpool Satelliten-Server, Version $VERSION ***
+ Eingerichtet am $(date)
Wenn Sie sich als root eingeloggt haben, haben Sie nun folgende Optionen:
netsetup - Konfiguriert das Netzwerk-Interface neu (DHCP oder statisch)