Start the PullRequest Proxy
Configure the PullRequest Proxy service to run.
At this point, we have configured the PullRequest Proxy enough where it can connect to the PullRequest application and to your source control provider. You can now go ahead and save the .env file you've been editing up until now. You no longer need to be logged in as the posting user at this point.
exitConfiguring the pullrequest-proxy service
For this step, we are assuming that the application is running on a Linux instance with systemd as the init process. These steps can be modified for things like supervisord or old-style init.d, as well.
First, let's open up a new service file under multi-user.target.wants.
vim /etc/systemd/system/multi-user.target.wants/pullrequest-proxy.serviceNow, paste the following in:
[Unit]
Description=PullRequest Proxy
Documentation=https://docs.pullrequest.com/on-premise-server/
[Service]
EnvironmentFile=/home/pullrequest/pullrequest_proxy/.env
ExecStart=/home/pullrequest/pullrequest_proxy/launcher.sh
WorkingDirectory=/home/pullrequest/pullrequest_proxy
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=pullrequest-proxy
Restart=always
Type=simple
User=pullrequest
[Install]
WantedBy=multi-user.targetIf you're familiar with these configurations, you can modify any of the options to match how you like your services to run.
The Restart=on-failure configuration option is important for the auto-upgrade feature as described later. For this feature, the new proxy binary is installed, and the old process exits. The restart pulls in the new version.
The following command should pull this configuration in to your running systemd instance.
systemctl daemon-reloadNow, go ahead and enable the service to start automatically on boot and start it.
systemctl enable pullrequest-proxy
systemctl start pullrequest-proxyTo check on the status, run the following:
systemctl status pullrequest-proxyTo stop or restart the service, the stop and restart commands can be used, respectively.
Configuring Logs
In the previous section, we configured the PullRequest Proxy service to run and started it. However, the configuration itself outputs logs to the running syslog service. Normally, these logs will be output to the /var/log/messages file. In order to output these logs to a different file, go ahead and open up a new configuration file under /etc/rsyslog.d.
vim /etc/rsyslog.d/pullrequest-proxy.confAdd the following in that file:
if $programname == 'pullrequest-proxy' then /var/log/pullrequest-proxy.log
& stopNow, restart rsyslog to pull in the new configuration:
systemctl restart rsyslogLast updated