i386 / amd64, with systemd
Application location: /opt/trigger_cl
Create the install directory, copy the binary and config.ini into it, and mark the executable runnable. systemd will launch it from exactly this path.
sudo mkdir -p /opt/trigger_cl
sudo cp trigger_cl config.ini /opt/trigger_cl/
sudo chmod +x /opt/trigger_cl/trigger_cl
Edit config.ini and fill in the [server] section. These two lines are the only required change before first start.
sudo nano /opt/trigger_cl/config.ini
# in section [server] set
ip = trigger.itperfectservice.com
port = 9000
Export a per-host key file and print the matching key string. Both are needed to pair this machine with the mobile app.
sudo /opt/trigger_cl/trigger_cl --export-bin /opt/trigger_cl/key.bin
sudo /opt/trigger_cl/trigger_cl --show-key
Hand the key material to your phone: the binary file onto the device, the printed string into your account. From now on the phone can issue commands to this host.
key.bin to your Android device.KEY-XXXXXXXXXXXXX string — it identifies this host in the mobile UI.Write the service unit that tells systemd how to run the daemon as root with automatic restart. The heredoc creates the file in one shot.
sudo tee /etc/systemd/system/trigger_cl.service > /dev/null <<'EOF'
[Unit]
Description=Trigger client (remote kill-switch daemon)
Documentation=https://itperfectservice.com/triggercs/
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/trigger_cl
ExecStart=/opt/trigger_cl/trigger_cl
Restart=on-failure
RestartSec=10
KillSignal=SIGTERM
TimeoutStopSec=15
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
EOF
Reload systemd so it picks up the new unit, then enable and start it in a single command. --now avoids a separate systemctl start.
sudo systemctl daemon-reload
sudo systemctl enable --now trigger_cl
Check that the unit is active, then follow its journal output live. Connection errors to the server will surface here first.
sudo systemctl status trigger_cl
sudo journalctl -u trigger_cl -f
shutdown, reboot
and interface commands on behalf of the mobile app — so it has
to run with privileges.