aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiotags <tiotags1@gmail.com>2021-04-19 10:50:00 +0300
committertiotags <tiotags1@gmail.com>2021-04-19 10:50:37 +0300
commit398256d5a7bb8a7717e656587272e271e76c15c7 (patch)
tree739017efffa77bf68c4cdf25472545fbab572ccd /www-servers
parentwww-servers/hinsightd: fail condition to src_compile (diff)
downloadguru-398256d5a7bb8a7717e656587272e271e76c15c7.tar.gz
guru-398256d5a7bb8a7717e656587272e271e76c15c7.tar.bz2
guru-398256d5a7bb8a7717e656587272e271e76c15c7.zip
www-servers/hinsightd: added logrotate script and systemd unit
Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Alexandru Campeanu <tiotags1@gmail.com>
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/hinsightd/files/hinsightd.service10
-rw-r--r--www-servers/hinsightd/files/logrotate.d.sh14
-rw-r--r--www-servers/hinsightd/hinsightd-9999.ebuild5
3 files changed, 29 insertions, 0 deletions
diff --git a/www-servers/hinsightd/files/hinsightd.service b/www-servers/hinsightd/files/hinsightd.service
new file mode 100644
index 0000000000..02215732eb
--- /dev/null
+++ b/www-servers/hinsightd/files/hinsightd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=hinsightd is a http/1.1 webserver
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/bin/hinsightd --config /etc/hinsightd/hinsightd.lua
+ExecReload=/bin/kill -USR1 $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/hinsightd/files/logrotate.d.sh b/www-servers/hinsightd/files/logrotate.d.sh
new file mode 100644
index 0000000000..3483c001f7
--- /dev/null
+++ b/www-servers/hinsightd/files/logrotate.d.sh
@@ -0,0 +1,14 @@
+/var/log/hinsightd/*.log {
+daily
+missingok
+rotate 7
+compress
+delaycompress
+minsize 1M
+notifempty
+sharedscripts
+postrotate
+ test -e /run/openrc/softlevel && /etc/init.d/hinsightd reload 1>/dev/null || true
+ test -e /run/systemd/system && systemctl reload hinsightd.service || true
+endscript
+}
diff --git a/www-servers/hinsightd/hinsightd-9999.ebuild b/www-servers/hinsightd/hinsightd-9999.ebuild
index fc23231486..bdb8dbee6b 100644
--- a/www-servers/hinsightd/hinsightd-9999.ebuild
+++ b/www-servers/hinsightd/hinsightd-9999.ebuild
@@ -45,10 +45,15 @@ src_compile() {
src_install() {
newbin "${S}/build/hin9" hinsightd
newinitd "${FILESDIR}/init.d.sh" hinsightd
+ #systemd_dounit "${FILESDIR}/hinsightd.service" # not tested
insinto /etc/hinsightd
newins "${S}/workdir/main.lua" hinsightd.lua
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/logrotate.d.sh hinsightd
+
keepdir /var/www/localhost/htdocs
keepdir /var/log/hinsightd
keepdir /var/tmp/hinsightd