Есть машина с jailaми, которые админятся через ezjail в который прикручен сетевой стек. Конфиг выглядет так.
# To specify the start up order of your ezjails, use these lines to
# create a Jail dependency tree. See rcorder(8) for more details.
#
# PROVIDE: standard_ezjail
# REQUIRE:
# BEFORE:
#
export jail_vpn0_rooml_ru_flags="-c vnet name=vpn0_rooml_ru allow.raw_sockets=1 allow.sysvipc=1"
#
export jail_vpn0_rooml_ru_hostname="vpn0.rooml.ru"
#
export jail_vpn0_rooml_ru_exec_prestart0="ifconfig epair0 create"
export jail_vpn0_rooml_ru_exec_prestart1="ifconfig bridge0 addm epair0a"
export jail_vpn0_rooml_ru_exec_prestart2="ifconfig epair0a up"
#
#export jail_vpn0_rooml_ru_exec_start="/bin/sh /etc/rc"
#
export jail_vpn0_rooml_ru_exec_poststart0="ifconfig epair0b vnet vpn0_rooml_ru"
export jail_vpn0_rooml_ru_exec_poststart1="jexec vpn0_rooml_ru ifconfig lo0 127.0.0.1"
export jail_vpn0_rooml_ru_exec_poststart2="jexec vpn0_rooml_ru ifconfig epair0b 192.168.5.2/24 up"
export jail_vpn0_rooml_ru_exec_poststart3="jexec vpn0_rooml_ru route add default 192.168.5.1"
export jail_vpn0_rooml_ru_exec_poststart4="jexec vpn0_rooml_ru /etc/rc.d/ipfw start"
export jail_vpn0_rooml_ru_exec_poststart5="jexec vpn0_rooml_ru /bin/sh /etc/rc"
#
#export jail_vpn0_rooml_ru_exec_poststop0="jexec vpn0_rooml_ru /bin/sh /etc/rc.shutdown"
#export jail_vpn0_rooml_ru_exec_poststop1="ifconfig bridge0 deletem epair0a"
#export jail_vpn0_rooml_ru_exec_poststop2="ifconfig epair0a destroy"
#
export jail_vpn0_rooml_ru_ip=""
export jail_vpn0_rooml_ru_rootdir="/usr/home/main/jail/vpn0.rooml.ru"
#export jail_vpn0_rooml_ru_exec_start1="/bin/sh /etc/rc"
export jail_vpn0_rooml_ru_exec_stop=""
export jail_vpn0_rooml_ru_mount_enable="YES"
export jail_vpn0_rooml_ru_devfs_enable="YES"
export jail_vpn0_rooml_ru_devfs_ruleset="devfsrules_jail"
export jail_vpn0_rooml_ru_procfs_enable="YES"
export jail_vpn0_rooml_ru_fdescfs_enable="YES"
export jail_vpn0_rooml_ru_image=""
export jail_vpn0_rooml_ru_imagetype=""
export jail_vpn0_rooml_ru_attachparams=""
export jail_vpn0_rooml_ru_attachblocking=""
export jail_vpn0_rooml_ru_forceblocking=""
export jail_vpn0_rooml_ru_zfs_datasets=""
export jail_vpn0_rooml_ru_cpuset=""
export jail_vpn0_rooml_ru_fib=""
export jail_vpn0_rooml_ru_parentzfs=""
export jail_vpn0_rooml_ru_parameters=""
export jail_vpn0_rooml_ru_post_start_script=""
Как видите "/bin/sh /etc/rc" стартует в секции poststart, а в start закомментирован, это нужно для того чтобы «rc» подгрузился после сетевого стека.
Так вот получается, что после старта jail стартует "/bin/sh /etc/rc" и некоторые процессы запускаются дважды. Выглядет это так:
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 2829 0.0 0.2 41560 5432 ?? SsJ 3:00AM 0:00.12 /usr/local/sbin/mpd5 -p /var/run/mpd5.pid -b
root 2960 0.0 0.1 14128 1872 ?? SsJ 3:00AM 0:00.02 /usr/sbin/cron -s
root 3086 0.0 0.1 12052 1788 ?? SsJ 3:00AM 0:00.06 /usr/sbin/syslogd -s
root 3110 0.0 0.2 45784 5512 ?? IsJ 3:00AM 0:00.13 /usr/local/sbin/mpd5 -p /var/run/mpd5.pid -b
mysql 3138 0.0 0.1 14504 2108 ?? IsJ 3:00AM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/vpn0.rooml.ru.pid
mysql 3232 0.0 2.9 522476 89940 ?? IJ 3:00AM 0:02.75 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --plugin-dir=/usr/local/lib/mysql/plugin --log-error=/var/db/mysql/vpn0.rooml.ru.err --pid-file=/var/db/mysql/vpn0.rooml.ru.pid
freeradius 3246 0.0 0.3 106432 8520 ?? IsJ 3:00AM 0:00.00 /usr/local/sbin/radiusd
root 3278 0.0 0.2 46744 5184 ?? IsJ 3:00AM 0:00.00 /usr/sbin/sshd
root 3282 0.0 0.1 14128 1856 ?? SsJ 3:00AM 0:00.01 /usr/sbin/cron -s
root 5178 0.0 0.1 14504 2320 3 SJ 3:31AM 0:00.02 sh
root 5182 0.0 0.1 14188 1764 3 R+J 3:32AM 0:00.01 ps auxwww
Как видно mpd и cron запущен дважды. Если смотреть /var/run/mpd.pid увидем 3310.
Никак не пойму что не так, и как rc то два раза стартует?