Skip to main content
When you finish this page, pgw starts at boot, restarts after a failure, and writes its log to the journal. The unit uses the user and the files from Install pgw on a server, so follow that page up to its configuration file first.

Create the unit

1

Write the unit file

Create /etc/systemd/system/pgw.service:
2

Enable and start pgw

3

Check that it started

The log ends with pgw ready and the addresses that pgw listens on. If it doesn’t, the last line says why pgw didn’t start.

Read the log

systemd sends pgw’s log to the journal:
Each line carries a syslog priority, so journalctl -p filters by level. To show only warnings and errors:
To change the log’s level, format, or color, set log_level, log_format, or log_color. See Settings.

Restart or reload pgw

A reload makes pgw read a new certificate, and closes no connection. Every other change needs a restart. You can restart pgw at any time, but calls that it is holding at that moment fail. When pgw stops, it answers those calls with 503, saves the registrations in flight, and finishes the pushes that it already started. This takes up to about 15 seconds, and the last log line is pgw stopped. To stop pgw at once, send a second SIGINT or SIGTERM.

Next steps

Install a TLS certificate

Replace the self-signed certificate, which apps reject.

Tune the host

Raise the UDP receive buffer and set the keepalive before many devices register.