Page tree

Upgrade procedure. Credentials for foreman.desy.de and qip.desy.de required.

Step-by-step guide

  1. check QIP entry, boot template has to be bios_linux. If you have to change it, wait up to one hour for the dhcp server to push the update
  2. comment additional network ethX configuartion lines in the host yaml file ( deb 9 has no ethX anymore)
  3. change the entry in foreman.desy.de.
    1. Make sure to set Environment/Umgebung to production and reselect puppet-master if it's empty.
    2. in the "schnittstellen" tab, click change on the main entry and make sure everything is set. Sometimes the IPv4 Subnet dropdown get's lost. If one changes the mac address, the IP address field always gets blank
    3. change the Betriebssystem/OS to Debian 10.7, partitiontable di Debian preserve /home. For replacement Hardware only di Debian (because no /home exists on empty harddrives)
  4. check the backup state,
    1. run dsmc incr.
    2. If there is no backup for this host, copy /usr/local/experiment, /home/$user and /opt/hidra/conf (if it exists, detectors only)
    3. if the desired, not backuped, host is a tango host ( echo $TANGO_HOST ) also run /usr/local/sbin/mysql_backup and copy /var/lib/mysqlbackup afterwards (check if something with the current date is in the folders)
  5. start the installation by booting from the network interface. If you have to replace the hardware and there is a sis1100 card make sure to also follow this: SIS1100 EEPROM Change
  6. wait at least 40 minutes. You can check if the basic installation is still running by checking the timestamp of puppetBootstrap.log in /root. If it's still updated, the installation still runs.
  7. run apt-get update && apt-get upgrade
  8. if you think it's done, make another puppet run to be sure. If puppet fails because of "userdel tango" not possible, do service tango-db stop and service tango-starter stop and run puppet again
  9. reboot
  10. restore the backup / copied files
    1. dsmc restore "/usr/local/experiment/*"
    2. dsmc restore "/var/lib/mysqlbackup/tango/*"
    3. dsmc restore "/var/lib/mysqlbackup/nxsconfig/*"
  11. if the desired host was a tango_host
    1. tango stop
    2. cd /var/lib/mysqlbackup/tango and use gunzip on the latest file
    3. mysql -u root -p -D tango < the_latest_file.sql
    4. cd /var/lib/mysqlbackup/nxsconfig and use gunzip on the latest file
    5. mysql -u root -p -D nxsconfig < the_latest_file.sql
    6. tango start
    7. check astor if everything works
  12. If online was or should be installed: follow the online/spectra installation procedure ( or ask thorsten to do it). There is an TkiRc.pl and exp_ini.exp in /online_dir/ if that is the case
  13. uncommenct the network eth configuration lines in the host yaml file again and change the interface names to the correct ones
  14. mv ~/.ipython/profile_spockdoor ~/.ipython/profile_spockdoor.old #as user → .k5login
  15. run SardanaAIO.py -x #as user → .k5login // check /online_dir/
  16. if SardanaAIO starts pool and macroserver, you might have to replace the python2.7 paths. One spot for this paths is /online_dir/SardanaConfig.py. Replace python2.7 by

    grep -rl 'python2.7' /online_dir/SardanaConfig.py |xargs sed -i 's/python2.7/python3/g'




PiLC Installation

Pilc Update


old (moved to pilc update article):

Pilc Image & alle Dateien

haso111g://home/medved/pilc_update

1. Update Debian 8 → Debian 9


1.1 Keys sichern


  • auf dem (noch unter Debian 8 laufenden) PiLC als root anmelden

  • hkdc status ausfuehren

  • wenn alles ok, dann

  • ./hkdcstore.sh ausfuehren

  • sonst fuer die files, die nicht als ok gemeldet werden,

  • hkdc set <tag> <file> ausfuehren und dann

  • ./hkdcstore ausfuehren

  • das entstandene tarfile (<hostname>_keys.tar) an einen sicheren Ort kopieren


1.2 Image auf SD-Karte kopieren


  • SD-Karte in Cardreader einlegen und Cardreader an PC anschliessen

  • pruefen, ob Karte gemounted wurde

  • falls ja, alle Partitionen der Karte unmounten

  • mit ‘./tosdcard -d /dev/sdb -i debian-stretch-pilcbase3b+.img -v’ image auf Karte schreiben (das dauert eine Weile …)

  • Cardreader aus PC entfernen


1.3 Image bearbeiten


  • SD-Karte in Cardreader einlegen und Cardreader an PC anschliessen

  • es werden zwei Partitionen gemountet (bootfs und rootfs)

  • ins Verzeichnis rootfs wechseln

  • die Datei etc/hostname editieren und korrekten Hostnamen eintragen

  • das tarfile mit den keys in Verzeichnis rootfs kopieren ubd entpacken, anschliessend tarfile loeschen

  • Verzeichnis opt/puppetlabs/puppet/cache/state anlegen

  • Datei opt/puppetlabs/puppet/cache/state/agent_disabled.lock anlegen
    (echo ‘{"disabled_message":"reason not specified"}’ > opt/puppetlabs/puppet/cache/state/agent_disabled.lock

  • bootfs / rootfs unmounten, Cardreader aus PC entfernen


1.4 PiLC updaten



  • im yaml-file diese Eintraege loeschen:


fsectango::version : 8
fsecdrivers::pilcupdateservice::install : true

und diesen hinzufuegen:

fsecdesktop::pilc::gui_install : true

Falls der PiLC ein horizontales Display hat (19”-Rack), auch noch diesen hinzufuegen:

fsecdesktop::pilc::displayorientation : 'horizontal'


Im yaml-file der pilcs darf der fsecdesktop::pilc::pilcuser nicht gesetzt sein.

und dann commiten / pushen.


  • dafuer sorgen, das die SD-Karte in den (richtigen) PiLC eingesetzt und das Geraet gebootet wird

  • per ssh als root auf dem Geraet anmelden

  • Mit raspi-config Dateisystem vergroessern (Advanced Options/A1 Expand Filesystem)

  • Rebooten

  • erneut als root anmelden

  • puppet agent --enable ausfuehren

  • puppet agent --test ausfuehren

  • apt-get update && apt-get --with-new-pkgs -y upgrade ausfuehren

  • puppet agent --test ausfuehren

  • rebooten

  • ps ax | grep python mehrmals wiederholen (ca. 15sec)

python3 ./gui.py – muss mit gleichem pid immer laufen, sonst Tango, Tangoserver... probleme

Probleme:


root@hash217lab2pilc01:~# ./hkdcstore.sh

find: `/etc/puppetlabs/puppet/ssl/': No such file or directory

Wrote hash217lab2pilc01_keys.tar




search your mails for Update_Spectra, maybe thorsten sent you instructions how to setup online