当前位置: 首页>>代码示例>>PHP>>正文


PHP rc_update_service函数代码示例

本文整理汇总了PHP中rc_update_service函数的典型用法代码示例。如果您正苦于以下问题:PHP rc_update_service函数的具体用法?PHP rc_update_service怎么用?PHP rc_update_service使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rc_update_service函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array_merge

            $reqdfieldst = array_merge($reqdfieldst, explode(" ", "string numeric"));
        }
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
        do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, &$input_errors);
    }
    if (!$input_errors) {
        $config['system']['swap']['enable'] = $_POST['enable'] ? true : false;
        $config['system']['swap']['type'] = $_POST['type'];
        $config['system']['swap']['mountpoint'] = $_POST['mountpoint'];
        $config['system']['swap']['devicespecialfile'] = $_POST['devicespecialfile'];
        $config['system']['swap']['size'] = $_POST['size'];
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("swap");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.type.disabled = endis;
	document.iform.mountpoint.disabled = endis;
	document.iform.size.disabled = endis;
	document.iform.devicespecialfile.disabled = endis;
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:31,代码来源:system_swap.php

示例2: isset

        $config['websrv']['dirlisting'] = isset($_POST['dirlisting']) ? true : false;
        // Write additional parameters.
        unset($config['websrv']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['websrv']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("websrvauth", "websrvauth_process_updatenotification");
            config_lock();
            $retval |= rc_exec_service("websrv_htpasswd");
            $retval |= rc_update_service("websrv");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if (0 == $retval) {
            updatenotify_delete("websrvauth");
        }
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    updatenotify_set("websrvauth", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
    header("Location: services_websrv.php");
    exit;
}
function websrvauth_process_updatenotification($mode, $data)
{
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:services_websrv.php

示例3: array_search_ex

if ($_GET['act'] === "retry") {
    $index = array_search_ex($_GET['uuid'], $config['mounts']['mount'], "uuid");
    if (false !== $index) {
        if (0 == disks_mount($config['mounts']['mount'][$index])) {
            rc_update_service("samba");
            rc_update_service("rsyncd");
            rc_update_service("afpd");
            rc_update_service("rpcbind");
            // !!! Do
            rc_update_service("mountd");
            // !!! not
            rc_update_service("nfsd");
            // !!! change
            rc_update_service("statd");
            // !!! this
            rc_update_service("lockd");
            // !!! order
        }
        header("Location: disks_mount.php");
        exit;
    }
}
function mountmanagement_process_updatenotification($mode, $data)
{
    global $config;
    if (!is_array($config['mounts']['mount'])) {
        return 1;
    }
    $index = array_search_ex($data, $config['mounts']['mount'], "uuid");
    if (false === $index) {
        return 1;
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:31,代码来源:disks_mount.php

示例4: write_config

        // Encode string, otherwise line breaks will get lost
        $config['system']['sysconsaver']['enable'] = $_POST['sysconsaver'] ? true : false;
        $config['system']['sysconsaver']['blanktime'] = $_POST['sysconsaverblanktime'];
        $config['system']['enableserialconsole'] = $_POST['enableserialconsole'] ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_exec_service("rcconf.sh");
            $retval |= rc_update_service("powerd");
            $retval |= rc_update_service("mdnsresponder");
            $retval |= rc_exec_service("motd");
            if (isset($config['system']['tune'])) {
                $retval |= rc_update_service("sysctl");
            }
            $retval |= rc_update_service("syscons");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
function sysctl_tune($mode)
{
    global $config;
    if (!is_array($config['system']['sysctl']['param'])) {
        $config['system']['sysctl']['param'] = array();
    }
    array_sort_key($config['system']['sysctl']['param'], "name");
    $a_sysctlvar =& $config['system']['sysctl']['param'];
    $a_mib = array("net.inet.tcp.delayed_ack" => 0, "net.inet.tcp.rfc1323" => 1, "net.inet.tcp.sendspace" => 262144, "net.inet.tcp.recvspace" => 262144, "net.inet.udp.recvspace" => 65536, "net.inet.udp.maxdgram" => 57344, "net.local.stream.recvspace" => 65536, "net.local.stream.sendspace" => 65536, "kern.ipc.maxsockbuf" => 2097152, "kern.ipc.somaxconn" => 8192, "kern.ipc.nmbclusters" => 32768, "kern.maxfiles" => 65536, "kern.maxfilesperproc" => 32768, "net.inet.icmp.icmplim" => 300, "net.inet.icmp.icmplim_output" => 1, "net.inet.tcp.inflight.enable" => 0, "net.inet.tcp.path_mtu_discovery" => 0);
    switch ($mode) {
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:31,代码来源:system_advanced.php

示例5: array

	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Services"), gettext("FTP"), gettext("Modules"));
$pconfig['mod_ban_enable'] = isset($config['ftpd']['mod_ban']['enable']);
if ($_POST) {
    $pconfig = $_POST;
    $config['ftpd']['mod_ban']['enable'] = isset($_POST['mod_ban_enable']) ? true : false;
    write_config();
    $retval = 0;
    if (!file_exists($d_sysrebootreqd_path)) {
        $retval |= updatenotify_process("ftpd_mod_ban", "ftpd_mod_ban_process_updatenotification");
        config_lock();
        $retval |= rc_update_service("proftpd");
        config_unlock();
    }
    $savemsg = get_std_save_message($retval);
    if ($retval == 0) {
        updatenotify_delete("ftpd_mod_ban");
    }
}
if (!isset($config['ftpd']['mod_ban']['rule']) || !is_array($config['ftpd']['mod_ban']['rule'])) {
    $config['ftpd']['mod_ban']['rule'] = array();
}
$a_rule =& $config['ftpd']['mod_ban']['rule'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
    if ($_GET['uuid'] === "all") {
        foreach ($a_rule as $rulek => $rulev) {
            updatenotify_set("ftpd_mod_ban", UPDATENOTIFY_MODE_DIRTY, $a_rule[$rulek]['uuid']);
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:services_ftp_mod.php

示例6: TORT

	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("Management"));
if ($_POST) {
    $pconfig = $_POST;
    if ($_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("device", "diskmanagement_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("ataidle");
            $retval |= rc_update_service("smartd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("device");
        }
        header("Location: disks_manage.php");
        exit;
    }
    if ($_POST['disks_rescan']) {
        $do_action = true;
        $disks_rescan = true;
    }
}
if (!isset($do_action)) {
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:31,代码来源:disks_manage.php

示例7: isset

        $config['ad']['username'] = $_POST['username'];
        $config['ad']['password'] = $_POST['password'];
        $config['ad']['enable'] = isset($_POST['enable']) ? true : false;
        if ($config['ad']['enable']) {
            $config['samba']['enable'] = true;
            $config['samba']['security'] = "ads";
            $config['samba']['workgroup'] = $_POST['domainname_netbios'];
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            rc_exec_service("pam");
            rc_exec_service("ldap");
            rc_start_service("nsswitch");
            rc_update_service("samba");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.domaincontrollername.disabled = endis;
	document.iform.domainname_dns.disabled = endis;
	document.iform.domainname_netbios.disabled = endis;
	document.iform.username.disabled = endis;
开发者ID:rterbush,项目名称:nas4free,代码行数:31,代码来源:access_ad.php

示例8: array

}
$a_timehour = array();
foreach (range(0, 23) as $hour) {
    $min = 0;
    $a_timehour[sprintf("%02.2d%02.2d", $hour, $min)] = sprintf("%02.2d:%02.2d", $hour, $min);
}
$a_lifetime = array("0" => gettext("infinity"), "1w" => sprintf(gettext("%d week"), 1), "2w" => sprintf(gettext("%d weeks"), 2), "30d" => sprintf(gettext("%d days"), 30), "60d" => sprintf(gettext("%d days"), 60), "90d" => sprintf(gettext("%d days"), 90), "180d" => sprintf(gettext("%d days"), 180), "1y" => sprintf(gettext("%d year"), 1), "2y" => sprintf(gettext("%d years"), 2));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $ret = array("output" => array(), "retval" => 0);
        if (!file_exists($d_sysrebootreqd_path)) {
            // Process notifications
            $ret = zfs_updatenotify_process("zfsautosnapshot", "zfsautosnapshot_process_updatenotification");
            config_lock();
            $ret['retval'] |= rc_update_service("autosnapshot");
            config_unlock();
        }
        $savemsg = get_std_save_message($ret['retval']);
        if ($ret['retval'] == 0) {
            updatenotify_delete("zfsautosnapshot");
            header("Location: disks_zfs_snapshot_auto.php");
            exit;
        }
        updatenotify_delete("zfsautosnapshot");
        $errormsg = implode("\n", $ret['output']);
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    $autosnapshot = array();
    $autosnapshot['uuid'] = $_GET['uuid'];
开发者ID:rterbush,项目名称:nas4free,代码行数:31,代码来源:disks_zfs_snapshot_auto.php

示例9: write_config

        write_config();
        $retval = 0;
        config_lock();
        $retval |= rc_exec_service("userdb");
        config_unlock();
        if ($dir != "/nonexistent" && file_exists($dir)) {
            // adjust permission
            chmod($dir, 0755);
            chown($dir, $user);
            chgrp($dir, $group);
            // update auth method
            $cmd = "/usr/local/bin/sudo -u {$user} /usr/local/bin/VBoxManage setproperty websrvauthlibrary null";
            mwexec2("{$cmd} 2>&1", $rawdata, $result);
            if (!file_exists($d_sysrebootreqd_path)) {
                config_lock();
                $retval |= rc_update_service("vbox");
                config_unlock();
            }
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
	function enable_change(enable_change) {
		var endis = !($('#enable').prop('checked') || enable_change);
		$('#homedir').prop('disabled', endis);
		$('#homedirbrowsebtn').prop('disabled', endis);
		if (endis) {
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:vm_vbox.php

示例10: array

require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Access"), gettext("Users"));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("userdb_user", "userdbuser_process_updatenotification");
            config_lock();
            $retval |= rc_exec_service("userdb");
            $retval |= rc_exec_service("websrv_htpasswd");
            $retval |= rc_exec_service("fmperm");
            if (isset($config['samba']['enable'])) {
                $retval |= rc_exec_service("passdb");
                $retval |= rc_update_service("samba");
            }
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("userdb_user");
        }
    }
}
if (!isset($config['access']['user']) || !is_array($config['access']['user'])) {
    $config['access']['user'] = array();
}
array_sort_key($config['access']['user'], "login");
$a_user =& $config['access']['user'];
$a_group = system_get_group_list();
开发者ID:rterbush,项目名称:nas4free,代码行数:31,代码来源:access_users.php

示例11: unset

                $config['lcdproc']['lcdproc']['param'][] = $param;
            }
        }
        unset($config['lcdproc']['lcdproc']['auxparam']);
        foreach (explode("\n", $_POST['lcdproc_auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['lcdproc']['lcdproc']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("LCDd");
            $retval |= rc_update_service("lcdproc");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);

	document.iform.driver.disabled = endis;
	document.iform.port.disabled = endis;
	document.iform.waittime.disabled = endis;
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:services_lcdproc.php

示例12: array_merge

        $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Working directory")));
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
        // Check if working directory exists
        if (!$_POST['mkdir'] && !file_exists($_POST['workdir'])) {
            $input_errors[] = gettext("The working directory does not exist.");
        }
    }
    if (!$input_errors) {
        $config['unison']['workdir'] = $_POST['workdir'];
        $config['unison']['enable'] = $_POST['enable'] ? true : false;
        $config['unison']['mkdir'] = $_POST['mkdir'] ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("unison");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
if (!is_array($config['mounts']['mount'])) {
    $config['mounts']['mount'] = array();
}
array_sort_key($config['mounts']['mount'], "devicespecialfile");
$a_mount =& $config['mounts']['mount'];
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:31,代码来源:services_unison.php

示例13: array

	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("sysctl.conf"));
if ($_POST) {
    if (isset($_POST['apply']) && $_POST['apply']) {
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            $retval |= updatenotify_process("sysctl", "sysctl_process_updatenotification");
            config_lock();
            $retval |= rc_update_service("sysctl");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            updatenotify_delete("sysctl");
        }
    }
}
if (!isset($config['system']['sysctl']['param']) || !is_array($config['system']['sysctl']['param'])) {
    $config['system']['sysctl']['param'] = array();
}
array_sort_key($config['system']['sysctl']['param'], "name");
$a_sysctlvar =& $config['system']['sysctl']['param'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
    if ($_GET['id'] === "all") {
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:system_sysctl.php

示例14: unset

        $config['ups']['email']['subject'] = $_POST['email_subject'];
        # Write additional parameters.
        unset($config['ups']['auxparam']);
        foreach (explode("\n", $_POST['auxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['ups']['auxparam'][] = $auxparam;
            }
        }
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_update_service("nut");
            $retval |= rc_update_service("nut_upslog");
            $retval |= rc_update_service("nut_upsmon");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);

	if (enable_change.name == "email_enable") {
		endis = !enable_change.checked;
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:30,代码来源:services_ups.php

示例15: unset

            }
        }
        unset($config['kerberos']['sssdauxparam']);
        foreach (explode("\n", $_POST['sssdauxparam']) as $auxparam) {
            $auxparam = trim($auxparam, "\t\n\r");
            if (!empty($auxparam)) {
                $config['kerberos']['sssdauxparam'][] = $auxparam;
            }
        }
        $config['kerberos']['enable'] = isset($_POST['enable']) ? true : false;
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            rc_exec_service("kerberos");
            $retval |= rc_update_service("sssd");
            config_unlock();
        }
        $savemsg = get_std_save_message($retval);
    }
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
var types = [ 'sss', 'ldap' ];

function enable_change(enable_change) {
	var endis = !(document.iform.enable.checked || enable_change);
	document.iform.kdc.disabled = endis;
	document.iform.realms.disabled = endis;
开发者ID:BillTheBest,项目名称:OpenNAS,代码行数:31,代码来源:access_kerberos.php


注:本文中的rc_update_service函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。