This commit is contained in:
Michael L 2019-09-30 12:09:12 -05:00 committed by Yury Martynov
parent 3724923475
commit d1b3a82d3d
No known key found for this signature in database
GPG key ID: EBE62DD0CCEAE19E
2 changed files with 24 additions and 3 deletions

View file

@ -0,0 +1,16 @@
[Unit]
Description = vuls-server daemon
Documentation = https://github.com/future-architect/vuls
[Service]
ExecStart = /usr/lib/go-gentoo/bin/vuls
ExecRestart = /bin/kill -WINCH ${MAINPID} ; /usr/lib/go-gentoo/bin/vuls
ExecStop = /bin/kill -WINCH ${MAINPID}
Restart = yes
Type = simple
User = vuls
Group = vuls
[Install]
WantedBy = multi-user.target

View file

@ -236,7 +236,7 @@ EGO_VENDOR=(
"honnef.co/go/tools 3f1c825 github.com/dominikh/go-tools"
)
inherit eutils golang-vcs-snapshot user
inherit eutils golang-vcs-snapshot systemd user
DESCRIPTION="Vulnerability scanner for Linux, agentless, written in Golang"
HOMEPAGE="https://vuls.io https://github.com/future-architect/vuls"
@ -246,7 +246,7 @@ SRC_URI="https://github.com/future-architect/vuls/archive/v${PV}.tar.gz -> ${P}.
KEYWORDS="~amd64"
LICENSE="GPL-2"
IUSE="policykit"
IUSE="policykit systemd"
SLOT=0
DEPEND="
@ -309,12 +309,16 @@ src_prepare() {
sed -e "s/var Version = \"\(.*\)\"/var Version = \"${PV}\"/" \
-i "src/${EGO_PN}/config/config.go" || die
cp "${FILESDIR}"/vuls-server.initd "${T}" || die
cp "${FILESDIR}"/vuls-server.{initd,service} "${T}" || die
if ! use policykit; then
sed -e "s/^USER=\"vuls\"/USER=\"root\"/" \
-e "s/^GROUP=\"vuls\"/GROUP=\"root\"/" \
-i "${T}"/vuls-server.initd || die
if use systemd; then
sed -e "s/^User = vuls//;s/^Group = vuls//" \
-i "${T}"/vuls-server.service || die
fi
fi
default
@ -344,6 +348,7 @@ src_install() {
fowners -R ${PN}:${PN} "/etc/${PN}"
fperms 0750 "/etc/${PN}"
use systemd && systemd_dounit "${T}"/vuls-server.service
newinitd "${T}"/vuls-server.initd vuls-server
newconfd "${FILESDIR}"/vuls-server.confd vuls-server