Startup scipt
KES
kes-kes at yandex.ru
Mon Dec 15 14:18:18 PST 2008
Здравствуйте, Questions.
It there feature (option in rc.subr) to run multiple services at once?
For example I have 'service'
to run service with specific flags I want to do:
service_enable="YES"
service_instances="instance1 instance2"
service_instance1_flags="-flag 1 rl0"
service_instance2_flags="-flag 2 rl2"
so rc.subr will run:
service -flag 1 rl0
service -flag 2 rl2
It will be great to have this feature that will do all dirty work to
run multiple services.
So maintainers of startup scripts will be free to not to do next things:
for interface in ${arpwatch_interfaces}; do
if [ ! -e "${arpwatch_dir}/arp.${interface}.dat" ]; then
if [ -e "${arpwatch_dir}/arp.${interface}.dat-" ]; then
cp "${arpwatch_dir}/arp.${interface}.dat-" "${arpwatch_dir}/arp.${interface}.dat"
else
touch "${arpwatch_dir}/arp.${interface}.dat"
fi
fi
done
EXAMPLES:
ipguard_enable="YES"
ipguard_instances="rl0 rl1 rl2"
ipguard_rl0_interface="rl0" #NOTICE: this instance are runned without flags
ipguard_rl1_interface="rl1"
ipguard_rl1_flags="-r -b 100 -f /etc/ethers"
ipguard_rl2_interface="rl2"
ipguard_rl2_flags="-u 300 -xz"
proftpd_enable="YES"
proftpd_instances="external internal"
proftpd_external_flags="-c external.conf"
proftpd_internal_flags="-c ftp_for_localnet.conf"
I do not know will be or not feature to on/off some instance:
for example:
ipguard_rl2_enable="NO"
proftpd_external_enable="NO"
By default all instances are enabled because of if user add second
instance it has first one already runned. And he add second instance
because of it is not enough to have only one instance. So
proftpd_enable="YES" will enable all instances
proftpd_enable="NO" will disable all instances
proftpd_external_enable="NO" will disable some instance
For example: user run three instances, but now want to disable one of
them. So it write <service_name>_<instance_name>_enable="NO"
What do you think about this improvement?
--
С уважением,
KES mailto:kes-kes at yandex.ru
More information about the freebsd-questions
mailing list