mirror of
https://github.com/opnsense/src.git
synced 2026-06-05 14:54:21 -04:00
This gives more permissions to services (e.g. network access to services which require this) when they are started as an automatic service jail. The sshd patch is important for the sshd-related functionality as described in the man-page in the service jails part. The location of the added env vars is supposed to allow overriding them in rc.conf, and to hard-disable the use of svcj for some parts where it doesn't make sense or will not work. Only a subset of all of the services are fully tested (I'm running this since more than a year with various services started as service jails). The untested parts should be most of the time ok, in some edge-cases more permissions are needed inside the service jail. Differential Revision: https://reviews.freebsd.org/D40371
36 lines
765 B
Bash
Executable file
36 lines
765 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
#
|
|
|
|
# PROVIDE: ipmon
|
|
# REQUIRE: FILESYSTEMS hostname sysctl
|
|
# BEFORE: SERVERS
|
|
# KEYWORD: nojailvnet
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ipmon"
|
|
desc="Monitors /dev/ipl for logged packets"
|
|
rcvar="ipmon_enable"
|
|
command="/sbin/${name}"
|
|
start_precmd="ipmon_precmd"
|
|
|
|
# no svcj options needed
|
|
: ${ipmon_svcj_options:=""}
|
|
|
|
ipmon_precmd()
|
|
{
|
|
# Continue only if ipfilter or ipnat is enabled and the
|
|
# ipfilter module is loaded.
|
|
#
|
|
if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then
|
|
err 1 "${name} requires either ipfilter or ipnat enabled"
|
|
fi
|
|
if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then
|
|
err 1 "ipfilter module is not loaded"
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|