Skip to content

add remote-fs.target to tomcat_lk.service startup ordering#78

Merged
labkey-willm merged 1 commit into
developfrom
fb_efs_remote_fs_target
Jun 12, 2026
Merged

add remote-fs.target to tomcat_lk.service startup ordering#78
labkey-willm merged 1 commit into
developfrom
fb_efs_remote_fs_target

Conversation

@labkey-willm

@labkey-willm labkey-willm commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds remote-fs.target to the After= directive in both step_tomcat_service_embedded and step_tomcat_service_standard service unit templates
  • Fixes a race condition where tomcat_lk.service started before the EFS/NFS mount was ready after a reboot

Root cause

The nightly update script reboots the server after installing new binaries. On boot, systemd was starting tomcat_lk.service (which only declared After=network.target) before the EFS mount at /mnt/efs_volume was available. The symlink /labkey/labkey/files → /mnt/efs_volume/files was broken at that moment, causing LabKey to abort with java.lang.IllegalArgumentException: Invalid site root: /labkey/labkey/files does not exist.

remote-fs.target is the standard systemd target that represents all _netdev remote filesystem mounts (NFS, EFS) being available. Adding it to After= is the correct fix for this class of race condition.

A companion PR in syseng-chef-server adds a replace_or_add block to patch this line in the service file on existing servers on the next Chef convergence.

Test plan

  • Confirm remote-fs.target appears in /etc/systemd/system/tomcat_lk.service on the nightly server after next Chef convergence
  • Confirm LabKey starts cleanly after the next nightly reboot — no "Invalid site root" in /labkey/labkey/logs/labkey.log

🤖 Generated with Claude Code

Fixes a race condition where tomcat_lk.service starts before the EFS
mount is ready after a system reboot. The nightly update script
(lk-ssm-update.sh) reboots the server after installing new binaries;
on boot, systemd was starting LabKey before the NFS/EFS mount at
/mnt/efs_volume was available, leaving the /labkey/labkey/files symlink
broken and causing LabKey to abort with "Invalid site root does not exist".

Adding remote-fs.target to After= ensures systemd waits for all _netdev
remote filesystem mounts before starting the service.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@labkey-willm labkey-willm merged commit e1d8cb9 into develop Jun 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants