Ejemplo n.º 1
0
/* convert configuration, if necessary */
/*
echo " - Converting configuration... ";
convert_config();
echo 'done', PHP_EOL;
*/
/* load kernel modules */
echo " - Loading kernel modules... ";
system_load_kernel_modules();
echo 'done', PHP_EOL;
/* run any early shell commands specified in config.xml */
echo ' - Running early shell commands... ';
system_do_shell_commands(1);
echo 'done', PHP_EOL;
echo ' - Configuring storage... ', PHP_EOL;
setupStorageDevices($config, null, true);
echo 'done', PHP_EOL;
echo ' - Configuring syslog... ', PHP_EOL;
restartSyslog($config);
echo 'done', PHP_EOL;
/* execute package boot routines */
/*
echo ' - Booting all packages... ';
packages_boot_all();
echo 'done', PHP_EOL;
*/
/* set up our timezone */
echo ' - Configuring timezone and locale settings... ';
writeSysRegSettings($config);
echo 'done', PHP_EOL;
/* set up our hostname */
Ejemplo n.º 2
0
$cfgPtr['fsmounts'][$svcMount]['comment'] = $confForm->getFldValue('desc');
$cfgPtr['fsmounts'][$svcMount]['active'] = $confForm->getFldValue('active');
$svcAvail = getAvailServices();
$svcSetNow = null;
foreach (array_keys($svcAvail) as $svc) {
    $svcActive = $confForm->getCbState($svc, 'yes', 'int');
    if ($svcActive === 1) {
        $cfgPtr['services'][$svc]['fsmount'] = $svcMount;
        $cfgPtr['services'][$svc]['active'] = 1;
        $svcSetNow[] = $svc;
    } else {
        if (isset($cfgPtr['services'][$svc]['fsmount'])) {
            if ($cfgPtr['services'][$svc]['fsmount'] == $svcMount) {
                $cfgPtr['services'][$svc]['active'] = 0;
            }
        }
    }
}
$data['debug'] = $cfgPtr;
$data['retval'] = 0;
write_config();
// stop any application that depends on changing settings
$callQueue = setupDoBefore($config, $svcAvail, $svcSetNow);
// mount and initialize storage
setupStorageDevices($config, $svcSetNow);
// reconfigure applications due to changed settings
$data['results']['reconf'] = setupDoCall($config, $callQueue['reconf']);
// start applications previously halted
$data['results']['defer'] = setupDoCall($config, $callQueue['defer']);
// return json data
exit(json_encode($data));