Commit a6132af6 authored by Franco Fichtner's avatar Franco Fichtner

rc: start to dump and restore package dabase

PR: https://forum.opnsense.org/index.php?topic=3082.0
parent b0250b97
...@@ -202,26 +202,31 @@ fi ...@@ -202,26 +202,31 @@ fi
echo "done." echo "done."
# restore pkg database if bootstrapped
if [ -f /conf/pkg.db ]; then
if pkg -N; then pkg backup -qr /conf/pkg.db; fi
fi
# regenerate groups and users for packages # regenerate groups and users for packages
/usr/local/etc/rc.recover pkg > /dev/null /usr/local/etc/rc.recover pkg > /dev/null
# Recreate capabilities DB # Recreate capabilities DB
/usr/bin/cap_mkdb /etc/login.conf /usr/bin/cap_mkdb /etc/login.conf
# Set up the correct php.ini content
/usr/local/etc/rc.php_ini_setup
# startup configd # startup configd
/usr/local/etc/rc.d/configd start /usr/local/etc/rc.d/configd start
# Execute the early syshook / plugin commands
/usr/local/etc/rc.syshook early
# Restore backups from previous shutdown (if any) # Restore backups from previous shutdown (if any)
/usr/local/etc/rc.backup_dhcpleases restore /usr/local/etc/rc.backup_dhcpleases restore
/usr/local/etc/rc.backup_netflow restore /usr/local/etc/rc.backup_netflow restore
/usr/local/etc/rc.backup_rrd restore /usr/local/etc/rc.backup_rrd restore
# Set up the correct php.ini content
/usr/local/etc/rc.php_ini_setup
# Execute the early syshook / plugin commands
/usr/local/etc/rc.syshook early
# let the PHP-based configuration subsystem set up the system now # let the PHP-based configuration subsystem set up the system now
echo -n "Launching the init system..." echo -n "Launching the init system..."
rm -f /root/lighttpd* rm -f /root/lighttpd*
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
/usr/local/etc/rc.backup_netflow /usr/local/etc/rc.backup_netflow
/usr/local/etc/rc.backup_rrd /usr/local/etc/rc.backup_rrd
# dump pkg database if bootstrapped
if pkg -N; then pkg backup -qd /conf/pkg.db; fi
# wait for config lock to release # wait for config lock to release
php -a >/dev/null << EOF php -a >/dev/null << EOF
\$fp = fopen('/conf/config.xml', "a+"); \$fp = fopen('/conf/config.xml', "a+");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment