Skip to content

Commit

Permalink
Fix #442: increase TimeoutStartSec and make configurable (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
e-carlin authored Feb 5, 2024
1 parent e09fa89 commit 802520e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion rsconf/component/vm_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def _create_user_instances():
z.ssh_guest_identity_pub_f = "/etc/ssh/identity.pub"
z.start_f = z.run_d.join("start")
z.stop_f = z.run_d.join("stop")
z.timeout_start_min = jc[self.module_name].get("timeout_start_min", 15)
z.vm_hostname = f"{self._user}.{jc[self.module_name].vm_parent_domain}"
systemd.unit_prepare(self, self.j2_ctx, watch_files=(z.start_f, z.stop_f))
self._network(jc, z)
Expand All @@ -57,7 +58,7 @@ def internal_build_write(self):
self.install_directory(z.run_d)
self.install_access(mode="500", owner=z.run_u)
self.install_resource("vm_devbox/start.sh", host_path=z.start_f)
self.install_resource("vm_devbox/start.sh", host_path=z.stop_f)
self.install_resource("vm_devbox/stop.sh", host_path=z.stop_f)
self.install_access(mode="444", owner=jc.rsconf_db.root_u)
self.install_resource(
"vm_devbox/vm_devbox_unit_service", jc, jc.systemd.service_f
Expand Down
2 changes: 1 addition & 1 deletion rsconf/package_data/vm_devbox/vm_devbox_unit_service.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ExecStart={{ this.start_f }}
ExecStop={{ this.stop_f }}
Group={{ this.run_u }}
SyslogIdentifier={{ systemd.service_name }}
TimeoutStartSec=10min
TimeoutStartSec={{ this.timeout_start_min }}min
Type=forking
User={{ this.run_u }}

Expand Down
3 changes: 2 additions & 1 deletion tests/pkcli/build_data/1.in/db/000.yml
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,10 @@ host:
sirepo_test_http:
on_calendar: "9:00"
vm_devbox:
vm_parent_domain: radia.run
timeout_start_min: 5
users:
- user-1
vm_parent_domain: radia.run

# testing named needs build-perl-rpms.sh
# - bivio_named
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -eou pipefail

vm_devbox_main() {
cd /srv/vm_devbox_user-1
vagrant halt
}

vm_devbox_main
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rsconf_install_access '700' 'vagrant' 'vagrant'
rsconf_install_directory '/srv/vm_devbox_user-1'
rsconf_install_access '500' 'vagrant' 'vagrant'
rsconf_install_file '/srv/vm_devbox_user-1/start' '5dc3180f1dfd32e5d9d15e426928e94a'
rsconf_install_file '/srv/vm_devbox_user-1/stop' '5dc3180f1dfd32e5d9d15e426928e94a'
rsconf_install_file '/srv/vm_devbox_user-1/stop' '17c8ef8fe2fa06489f4e9cb5869d22b6'
rsconf_install_access '444' 'root' 'root'
rsconf_install_file '/etc/systemd/system/vm_devbox_user-1.service' 'bcc048be3260244008a695125c53fc9f'
rsconf_install_file '/etc/systemd/system/vm_devbox_user-1.service' '9bea6d3fc6b169474e19863d1e2da5a3'
}

0 comments on commit 802520e

Please sign in to comment.