Recipe for Lighting Server

VM - 15 GB HDD, 1024 MB RAM, 1 socket/2 cores

  • base netinst install of stretch (64-bit) - deselect everything from tasksel
    • hostname lighting – domain ds.mcp.lcl
    • auto-partition (single partition)
  • > /etc/motd
  • apt-get --no-install-recommends install aptitude
  • aptitude install ssh (deselect xauth)
  • aptitude install screen rsync psmisc file patch ethtool strace tcpdump vim less net-tools man-db
  • aptitude --without-recommends install dnsutils
  • adduser tdobes adm
  • adduser tdobes systemd-journal
  • aptitude install dbus (no longer required because ssh pulls in libpam-systemd, which requires dbus)
  • mkdir -p /etc/systemd/system/getty\@tty1.service.d
    echo '[Service]' > /etc/systemd/system/getty\@tty1.service.d/noclear.conf
    echo 'TTYVTDisallocate=no' >> /etc/systemd/system/getty\@tty1.service.d/noclear.conf
  • systemctl mask keyboard-setup.service
    systemctl mask console-setup.service
    systemctl mask rc-local.service
  • echo >> /etc/network/interfaces
    echo '# lighting network' >> /etc/network/interfaces
    echo 'allow-hotplug ens19' >> /etc/network/interfaces
    echo 'iface ens19 inet static' >> /etc/network/interfaces
    echo $'\taddress 192.168.23.20' >> /etc/network/interfaces
    echo $'\tnetmask 255.255.255.0' >> /etc/network/interfaces
    ifup ens19
  • aptitude install ola
  • aptitude install python ola-python
  • aptitude install mosquitto-clients
  • wget http://ftp.us.debian.org/debian/pool/main/m/mosquitto/python-mosquitto_1.3.4-2_all.deb
    dpkg -i python-mosquitto_1.3.4-2_all.deb
  • systemctl stop olad && killall olad
    shopt -s extglob
    sed -i 's/enabled = true/enabled = false/g' /etc/ola/!(*artnet.conf)
    shopt -u extglob
    
    sed -i 's/^ip =.*$/ip = ens19/g' /etc/ola/ola-artnet.conf
    
    echo '[Unit]' > /etc/systemd/system/olad.service
    echo 'Description=OLA daemon' >> /etc/systemd/system/olad.service
    echo 'After=network.target' >> /etc/systemd/system/olad.service
    echo >> /etc/systemd/system/olad.service
    echo '[Service]' >> /etc/systemd/system/olad.service
    echo 'ExecStart=/usr/bin/olad --syslog --log-level 3 --config-dir /etc/ola' >> /etc/systemd/system/olad.service
    echo 'User=olad' >> /etc/systemd/system/olad.service
    echo 'Restart=always' >> /etc/systemd/system/olad.service
    echo 'RestartSec=2' >> /etc/systemd/system/olad.service
    echo >> /etc/systemd/system/olad.service
    echo '[Install]' >> /etc/systemd/system/olad.service
    echo 'WantedBy=multi-user.target' >> /etc/systemd/system/olad.service
    systemctl daemon-reload && systemctl enable olad.service
    
    ** setup files to copy artnet port 10 to ftdi and restore config in case of issues:
    mkdir /root/ola-backup
    echo '2-1-I-0 = 5' > /root/ola-backup/ola-port.conf
    echo 'uni_5_merge = LTP' > /root/ola-backup/ola-universe.conf
    echo 'uni_5_name = magicq' >> /root/ola-backup/ola-universe.conf
    chown olad:olad /root/ola-backup/ola-port.conf /root/ola-backup/ola-universe.conf
    chmod 664 /root/ola-backup/ola-port.conf /root/ola-backup/ola-universe.conf
    echo '#!/bin/sh' > /root/ola-backup/restore.sh
    echo 'cp -a `dirname $0`/*.conf /etc/ola/' >> /root/ola-backup/restore.sh
    chmod +x /root/ola-backup/restore.sh
    
    echo '[Unit]' > /etc/systemd/system/restore_ola_backup.service
    echo 'Description=Restore OLA backup' >> /etc/systemd/system/restore_ola_backup.service
    echo 'Before=olad.service' >> /etc/systemd/system/restore_ola_backup.service
    echo >> /etc/systemd/system/restore_ola_backup.service
    echo '[Service]' >> /etc/systemd/system/restore_ola_backup.service
    echo 'Type=oneshot' >> /etc/systemd/system/restore_ola_backup.service
    echo 'ExecStart=/root/ola-backup/restore.sh' >> /etc/systemd/system/restore_ola_backup.service
    echo >> /etc/systemd/system/restore_ola_backup.service
    echo '[Install]' >> /etc/systemd/system/restore_ola_backup.service
    echo 'WantedBy=multi-user.target' >> /etc/systemd/system/restore_ola_backup.service
    systemctl enable restore_ola_backup.service
    
    systemctl start restore_ola_backup && systemctl start olad
computer/lighting_server.txt · Last modified: 2017/03/27 17:37 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS