Skip to content

Commit

Permalink
rc: start to dump and restore package dabase
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed May 26, 2016
1 parent b0250b9 commit a6132af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/etc/rc
Original file line number Diff line number Diff line change
Expand Up @@ -202,26 +202,31 @@ fi

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
/usr/local/etc/rc.recover pkg > /dev/null

# Recreate capabilities DB
/usr/bin/cap_mkdb /etc/login.conf

# Set up the correct php.ini content
/usr/local/etc/rc.php_ini_setup

# startup configd
/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)
/usr/local/etc/rc.backup_dhcpleases restore
/usr/local/etc/rc.backup_netflow 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
echo -n "Launching the init system..."
rm -f /root/lighttpd*
Expand Down
3 changes: 3 additions & 0 deletions src/etc/rc.halt.common
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
/usr/local/etc/rc.backup_netflow
/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
php -a >/dev/null << EOF
\$fp = fopen('/conf/config.xml', "a+");
Expand Down

0 comments on commit a6132af

Please sign in to comment.