Added aPacakage and removed some
This commit is contained in:
25
mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd
Normal file
25
mail-filter/amavisd-new/files/amavisd-snmp-subagent.initd
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/sbin/amavisd-snmp-subagent"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
# The RELEASE_NOTES say "it is safe to run it as root, although
|
||||
# perhaps not necessary." I'm not in a position to test, but I bet
|
||||
# it's safe to run this as amavis:amavis. Since the program itself
|
||||
# doesn't have the ability to drop privileges, we'd have to let OpenRC
|
||||
# do that; and in that case, the easiest way to deal with the PID file
|
||||
# is to let OpenRC handle that, too.
|
||||
#
|
||||
# Thus as a means of future-proofing, we run $command in the
|
||||
# foreground, and let OpenRC background it and write a PID file. So
|
||||
# if somebody wants to try command_user="amavis:amavis" here, it might
|
||||
# just work.
|
||||
command_args="-f"
|
||||
command_background="true"
|
||||
|
||||
depend() {
|
||||
use logger
|
||||
before amavisd-new snmpd
|
||||
}
|
||||
42
mail-filter/amavisd-new/files/amavisd.initd-r2
Normal file
42
mail-filter/amavisd-new/files/amavisd.initd-r2
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
extra_started_commands="reload"
|
||||
command="/usr/sbin/${RC_SVCNAME}"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
# Why run in the foreground? Typically amavisd will drop privileges
|
||||
# and then write its own PID file in its home directory. This is fine
|
||||
# so long as you use e.g. "amavisd stop" to stop the daemon. But, we
|
||||
# want to use start-stop-daemon to do it. And start-stop-daemon will
|
||||
# send a signal *as root* to the PID contained in the PID file. So, we
|
||||
# don't want to rely on a PID file that's controlled by a non-root
|
||||
# user.
|
||||
#
|
||||
# As a workaround, we run amavisd in the foreground, and let
|
||||
# start-stop-daemon push it into the background with its own PID
|
||||
# file. We don't pass "-P" via command_args below because we don't
|
||||
# want amavisd to try (and fail) to create that PID file. This does
|
||||
# mean that you can't run "amavisd stop" or "amavisd reload" directly;
|
||||
# sorry!
|
||||
command_args="foreground"
|
||||
command_background="true"
|
||||
|
||||
# The amavisd daemon provides its own "stop" and "reload" functions,
|
||||
# but if you read into the source, they just do what start-stop-daemon
|
||||
# is going to do anyway. The "stop" command for amavisd will send a
|
||||
# SIGTERM immediately, and then a SIGKILL after 60 seconds. So, we do
|
||||
# that too. The "reload" command sends a SIGHUP; see reload() below.
|
||||
retry="SIGTERM/15 SIGKILL/60"
|
||||
|
||||
depend() {
|
||||
use net logger antivirus snmpd
|
||||
before mta
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading ${RC_SVCNAME}"
|
||||
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
||||
eend $?
|
||||
}
|
||||
21
mail-filter/amavisd-new/files/amavisd.service-r1
Normal file
21
mail-filter/amavisd-new/files/amavisd.service-r1
Normal file
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Amavisd Daemon
|
||||
Before=postfix.service
|
||||
After=clamd.service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=amavis
|
||||
Group=amavis
|
||||
ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf foreground
|
||||
ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload
|
||||
PrivateTmp=true
|
||||
CapabilityBoundingSet=
|
||||
ProtectSystem=full
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
ProtectHome=true
|
||||
MemoryDenyWriteExecute=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user