has_old_layout() { test -d /opt/sonatype-work/nexus/conf && ! test -d /var/lib/nexus/conf } post_install() { systemd-sysusers nexus.conf systemd-tmpfiles --create nexus.conf cat <>>" echo ">>>" echo ">>> Found old Nexus package layout." echo ">>>" echo ">>> You need to move all the content of /opt/sonatype-work/nexus" echo ">>> to /var/log/nexus and /var/lib/nexus, e.g." echo ">>>" echo ">>> mv /opt/sonatype-work/nexus/logs/* /var/log/nexus" echo ">>> rm -rf /opt/sonatype-work/nexus/logs" echo ">>> mv /opt/sonatype-work/nexus/* /var/lib/nexus" echo ">>>" echo ">>> Re-enable nexus.service if needed" echo ">>>" echo ">>> systemctl enable --now nexus.service" echo ">>>" echo ">>>" fi } pre_remove() { systemctl disable --now nexus } post_remove() { systemctl daemon-reload }