apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.06k stars 340 forks source link

Add t3c flag to avoid systemd #5829

Open rob05c opened 3 years ago

rob05c commented 3 years ago

Right now, t3c (and ORT before it) call systemd to reload and restart services. This doesn't work with the CiaB, which doesn't have systemd on its cache Docker container. This could also be an issue if someone wanted to run t3c on a machine without SystemD.

We should

  1. add a flag to t3c to not use systemd/systemctl/service if they don't exist (maybe a ternary like the git flag: use, use if exists, don't use)
  2. attempt to use ATS' own reload/restart command (traffic_ctl or trafficserver) if systemd/systemctl/service doesn't exit or fails.

I'm submitting a ...

Traffic Control components affected ...

Current behavior:

New behavior:

Minimal reproduction of the problem with instructions:

Anything else:

jrushford commented 3 years ago

@zrhoffman I ran into this issue with the CentOS 7 docker container used as part of the ORT integration tests. Since the ORT integration tests were not dependent on ATS actually running, I replaced systemctl in the docker container with a bash script to return 0 so that t3c would succeed. This approach could be used in CIAB but the replacement script could actually run the /opt/trafficserver/bin/trafficserver init script. I really don't think the t3c flag is necessary IMO.

rob05c commented 3 years ago

I feel like it'd be valuable anyway, not just for the CiaB, to have a flag that says "never do system stuff," so someone could allow it to work in other environments, not just Docker, or if they want to do that with an automation tool like Ansible or Puppet instead of t3c. A general ternary flag to "use system / call ATS directly / don't call anything" just seems like it'd give users more power and flexibility, for however they want to operate.

jrushford commented 3 years ago

Or just modify t3c to call the trafficserver init script directly instead of using OS tools. Systemd doesn't really add any value to stop/starting ATS anyway. FreeBSD and Ubuntu use the script directly