Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include examples for logrotate and systemd #173

Closed
troy2914 opened this issue Jan 19, 2019 · 3 comments
Closed

include examples for logrotate and systemd #173

troy2914 opened this issue Jan 19, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@troy2914
Copy link
Member

troy2914 commented Jan 19, 2019

for logrotate and systemd

ex:
to rotate the log install a file like the below:

install as /etc/logrotate.d/irrd with permissions 0644

/home/irrd/server.log {
    missingok
    daily
    compress
    delaycompress
    dateext
    rotate 35
    olddir /home/irrd/logs
    postrotate
        systemctl reload irrd.service > /dev/null 2>&1 || true
    endscript
}

be sure to create the directory /home/irrd/logs

a sample system service file while using setcap looks like:

install as /lib/systemd/system/irrd.service

[Unit]
Description=IRRD4 Service
Wants=basic.target
After=basic.target network.target
  
[Service]
Type=simple
WorkingDirectory=/home/irrd
User=irrd
Group=irrd
PIDFile=/home/irrd/irrd.pid
ExecStart=/home/irrd/irrd-venv/bin/twistd -n --pidfile=/home/irrd/irrd.pid irrd
Restart=on-failure
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

then run:

systemctl daemon-reload
systemctl enable irrd
systemctl start irrd
@troy2914 troy2914 added this to To do in IRRDv4 phase 1 via automation Jan 19, 2019
@troy2914
Copy link
Member Author

Just added an ExecReload command to service file to support systemctl reload irrd.service

@mxsasha
Copy link
Collaborator

mxsasha commented Jan 28, 2019

I can add these, that'll be helpful for other deployments. Note that I haven't tested them myself, I'm assuming you've tried them out on your server.

@mxsasha mxsasha self-assigned this Jan 28, 2019
@mxsasha mxsasha added the enhancement New feature or request label Jan 28, 2019
@mxsasha mxsasha removed this from To do in IRRDv4 phase 1 Jan 28, 2019
@job
Copy link
Member

job commented Jan 28, 2019 via email

@mxsasha mxsasha added this to To do in NTT Support Contract 2019 via automation Jan 29, 2019
@mxsasha mxsasha added this to the IRRD 4.0.0 milestone Jan 29, 2019
@mxsasha mxsasha closed this as completed in 0a2c298 Feb 6, 2019
NTT Support Contract 2019 automation moved this from To do to Done Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

3 participants