toxiproxy: Unit toxiproxy.service not found

Hi 👋

I’m trying to install toxiproxy following the ubuntu instructions:

$ wget -O toxiproxy-2.1.3.deb https://github.com/Shopify/toxiproxy/releases/download/v2.1.3/toxiproxy_2.1.3_amd64.deb
$ sudo dpkg -i toxiproxy-2.1.3.deb
$ sudo service toxiproxy start

But i’m getting Failed to start toxiproxy.service: Unit toxiproxy.service not found. after running $ sudo service toxiproxy start

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@jpittis, I’m new here, so I haven’t yet worked out how to submit a pull request for a package file, however I can assist with a solution.

Upstart is deprecated on Ubuntu after 16.04 and there is no Upstart package available for 18.04.

I have created a toxiproxy.service using /etc/init/toxiproxy.conf as a template. I am testing with 18.04. The toxiproxy.service file needs to be created in /lib/systemd/system. The service can then be started with sudo systemctl start toxiproxy.

[Unit]
Description=TCP proxy to simulate network and system conditions
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=simple
Environment=HOST=localhost
Environment=PORT=8474
ExecStart=/usr/bin/toxiproxy-server -port $PORT -host $HOST
Restart=on-failure

[Install]
WantedBy=multi-user.target

Omg. You could just have included the file provided by @jimkleine until you have a better solution because now it is not working out of the box for 100% of Ubuntu users. And that - for two years so far.

Note: even though this issue was closed, the issue still persists since #296 wasn’t merged.

Just to FYI, services in Ubuntu and other Linux distributions now have changed their nomenclature. Services have to be started like: sudo systemctl start toxiproxy No more: sudo system toxiproxy start. Although this command might work, I think is just for being backward compatible, but I guess in the future this will be removed.

Back to the issue, I guess the simple answer is there is no toxiproxy.service file for systemctl to start, so obviously the start command is going to fail. If you look at /etc/init.d/ or /etc/systemd/ there is no toxiproxy.service.

I don’t think this is a huge issue, but can be solved very easy I f you know the parameters to config a service file.

I’m not super comfortable with all this daemon stuff but I’ll try to help debug.

Alright so I see /etc/init/toxiproxy.conf on my machine so the conf file is present as it should be.

So file /sbin/init shows me /sbin/init: symbolic link to /lib/systemd/systemd which I think means my machine is running systemd.

So my understanding is that /etc/init is for Upstart and /etc/init.d is for systemd. And because we’re both running a systemd machine, it doesn’t work with Toxiproxy’s Upstart config.

So tldr: You’re on a systemd machine and toxiproxy only supports Upstart. IMO we should support both systemd as well as upstart. I’m going to tag this issue as needing a fix.

Any update on this? I’m running into the same problem.

Thanks for opening an issue @bronzdoc. I’ll get to this as soon as I can.