trafficcontrol icon indicating copy to clipboard operation
trafficcontrol copied to clipboard

Add t3c flag to avoid systemd

Open rob05c opened this issue 4 years ago • 3 comments

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 ...

  • new feature / enhancement request
  • other

Traffic Control components affected ...

  • CDN in a Box
  • Documentation
  • Grove
  • Traffic Control Client
  • Traffic Monitor
  • Traffic Ops
  • Traffic Ops ORT
  • Traffic Portal
  • Traffic Router
  • Traffic Stats
  • Traffic Vault
  • CI tests
  • unknown

Current behavior:

New behavior:

Minimal reproduction of the problem with instructions:

Anything else:

rob05c avatar May 10 '21 17:05 rob05c

@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.

jrushford avatar May 11 '21 15:05 jrushford

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.

rob05c avatar May 11 '21 15:05 rob05c

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

jrushford avatar May 11 '21 15:05 jrushford