Skip to content

Instantly share code, notes, and snippets.

@billmeyer
Last active March 18, 2020 13:00
Show Gist options
  • Save billmeyer/119942df8ec9533a2f10e81fc5d3f7f8 to your computer and use it in GitHub Desktop.
Save billmeyer/119942df8ec9533a2f10e81fc5d3f7f8 to your computer and use it in GitHub Desktop.
# File: /root/sauceconnect/config-rdc.yml
user: "TESTOBJECT_USERNAME"
api-key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
logfile: "/tmp/sc.rdc.log"
pidfile: "/tmp/sc.rdc.pid"
se-port: 4101
metrics-address: "localhost:4102"
rest-url: "https://us1.api.testobject.com/sc/rest/v1"
shared-tunnel: true
tunnel-identifier: "qa-rdc-1"
verbose: 1
no-remove-colliding-tunnels: "true"
# File: /root/sauceconnect/config-vdc.yml
user: "SAUCE_USERNAME"
api-key: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
logfile: "/tmp/sc.vdc.log"
pidfile: "/tmp/sc.vdc.pid"
se-port: 4001
metrics-address: "localhost:4002"
rest-url: "https://app.saucelabs.com/rest/v1"
shared-tunnel: true
tunnel-identifier: "qa-vdc-1"
verbose: 1
no-remove-colliding-tunnels: "true"

Setup

  1. Copy the files attached to this Gist and place them in their respective directories:

  2. Be sure to changes the permissions on /root/sauceconnect/*.yml to user readable:

    $ sudo chmod 600 /root/sauceconnect/*.yml

and that the file is owned by root:

$ sudo chown -R root:root /root/sauceconnect
  1. With the files in place, reload systemd:

    $ sudo systemctl daemon-reload

  2. Enable the services to autostart on system boot:

    $ sudo systemctl enable sc*

Operation

To Start the VDC tunnel:

$ sudo systemctl start sc-vdc

To Stop the VDC tunnel:

$ sudo systemctl start sc-vdc

To Start the RDC tunnel:

$ sudo systemctl start sc-rdc

To Stop the RDC tunnel:

$ sudo systemctl start sc-rdc

[Unit]
Description=Sauce Connect Service for RDC Tunnels
After=network-online.target
[Service]
Type=simple
LimitNOFILE=8192
Restart=always
WorkingDirectory=/tmp
User=root
ExecStart = /usr/local/bin/sc --config-file /root/sauceconnect/config-rdc.yml
[Install]
WantedBy=multi-user.target
[Unit]
Description=Sauce Connect Service for VDC Tunnels
After=network-online.target
[Service]
Type=simple
LimitNOFILE=8192
Restart=always
WorkingDirectory=/tmp
User=root
ExecStart = /usr/local/bin/sc --config-file /root/sauceconnect/config-vdc.yml
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment