# /etc/systemd/system/atm.service (alternativa ao pm2; ajuste usuário e caminhos) # useradd --system --home /opt/atm --shell /usr/sbin/nologin atm # systemctl daemon-reload && systemctl enable --now atm && journalctl -u atm -f [Unit] Description=ATM Uniformes (ERP) After=network.target mysql.service [Service] Type=simple User=atm Group=atm WorkingDirectory=/opt/atm EnvironmentFile=/opt/atm/.env ExecStart=/usr/bin/node app.js Restart=on-failure RestartSec=5 # Endurecimento (teste depois de ativar; se o Chromium/Playwright dos PDFs reclamar, afrouxe ProtectSystem) NoNewPrivileges=true PrivateTmp=true ProtectSystem=full ProtectHome=true ProtectKernelTunables=true ProtectControlGroups=true ReadWritePaths=/opt/atm [Install] WantedBy=multi-user.target