ConSol-Monitoring / mod-gearman-worker-go

Mod-Gearman Worker rewrite in Golang
GNU General Public License v3.0
7 stars 10 forks source link

Systemd service and logroate configuration #28

Closed nook24 closed 6 months ago

nook24 commented 6 months ago

Hi, I noticed that there are no predefined systemd service definition and logrotate config in this repository so I created some.

That's my systemd service file mod-gearman-worker.service

[Unit]
Description=Mod-Gearman-Worker Go
Documentation=https://github.com/ConSol-Monitoring/mod-gearman-worker-go
After=network.target syslog.target

[Service]
Type=exec
ExecStart=/opt/mod_gearman/bin/mod_gearman_worker --config=/opt/mod_gearman/etc/worker.cfg
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=30
User=naemon
Group=naemon

[Install]
WantedBy=multi-user.target

And this is my logrotate config /etc/logrotate.d/openitcockpit-mod-gearman-worker

/opt/mod_gearman/logs/mod_gearman_worker.log {
    copytruncate
    missingok
    daily
    rotate 14
    compress
    delaycompress
    dateext
    dateformat -%Y%m%d
    ifempty
    postrotate
        /usr/bin/systemctl reload mod-gearman-worker.service > /dev/null 2>&1 || true
    endscript
    create 0664 naemon naemon
}

I was not sure where to place them in the repository so I created this issue instead.

Feel free to copy.

sni commented 6 months ago

thanks, I'll leave it here for reference.