How to set PMM agent to self start when the system restarts

How to set PMM agent to self start when the system restarts?
Please provide complete and detailed code, thanks

1 Like

Hi @xiangqianforth

Which installation method was performed in your system?
Have you used a package manager?

1 Like

I use binary package to install agent.


The installation method of package manager is not applicable to the local environment

1 Like

Hello, the rpm/deb packages include start/stop scripts for systemd. In this case you are using the tarball so you will need to handle that yourself. Here’s the contents of the systemd script we ship:

[Unit]
Description=pmm-agent
After=time-sync.target network.target

[Service]
Type=simple
ExecStart=/usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
Restart=always
RestartSec=2s

[Install]
WantedBy=multi-user.target 
1 Like