• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP killbypid函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dhcpv6_apply_changes

function dhcpv6_apply_changes($dhcpdv6_enable_changed)
{
    $retval = 0;
    $retvaldhcp = 0;
    $retvaldns = 0;
    /* Stop DHCPv6 so we can cleanup leases */
    killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
    // dhcp_clean_leases();
    /* dnsmasq_configure calls dhcpd_configure */
    /* no need to restart dhcpd twice */
    if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
        $retvaldns = services_dnsmasq_configure();
        if ($retvaldns == 0) {
            clear_subsystem_dirty('hosts');
            clear_subsystem_dirty('staticmaps');
        }
    } else {
        if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
            $retvaldns = services_unbound_configure();
            if ($retvaldns == 0) {
                clear_subsystem_dirty('unbound');
                clear_subsystem_dirty('staticmaps');
            }
        } else {
            $retvaldhcp = services_dhcpd_configure();
            if ($retvaldhcp == 0) {
                clear_subsystem_dirty('staticmaps');
            }
        }
    }
    if ($dhcpdv6_enable_changed) {
        $retvalfc = filter_configure();
    }
    if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
        $retval = 1;
    }
    return get_std_save_message($retval);
}
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:38,代码来源:services_dhcpv6.php


示例2: install_cron_job

                    break;
                case 'weekly':
                    install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "0");
                    break;
                case 'monthly':
                    // fall through
                // fall through
                default:
                    install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "1", "*", "*");
            }
            $config['system']['bogons']['interval'] = $_POST['bogonsinterval'];
        }
        write_config();
        // Kill filterdns when value changes, filter_configure() will restart it
        if ($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval'] && isvalidpid("{$g['varrun_path']}/filterdns.pid")) {
            killbypid("{$g['varrun_path']}/filterdns.pid");
        }
        $retval = 0;
        $retval = filter_configure();
        if (stristr($retval, "error") != true) {
            $savemsg = get_std_save_message($retval);
            $class = 'success';
        } else {
            $savemsg = $retval;
            $class = 'warning';
        }
    }
}
$pgtitle = array(gettext("System"), gettext("Advanced"), htmlspecialchars(gettext("Firewall & NAT")));
include "head.inc";
if ($input_errors) {
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:31,代码来源:system_advanced_firewall.php


示例3: service_control_restart

function service_control_restart($name, $extras)
{
    switch ($name) {
        case 'radvd':
            services_radvd_configure();
            break;
        case 'ntpd':
            system_ntp_configure();
            break;
        case 'apinger':
            killbypid("/var/run/apinger.pid");
            setup_gateways_monitor();
            break;
        case 'bsnmpd':
            services_snmpd_configure();
            break;
        case 'dhcrelay':
            services_dhcrelay_configure();
            break;
        case 'dhcrelay6':
            services_dhcrelay6_configure();
            break;
        case 'dnsmasq':
            services_dnsmasq_configure();
            break;
        case 'unbound':
            services_unbound_configure();
            break;
        case 'dhcpd':
            services_dhcpd_configure();
            break;
        case 'igmpproxy':
            services_igmpproxy_configure();
            break;
        case 'miniupnpd':
            upnp_action('restart');
            break;
        case 'ipsec':
            vpn_ipsec_force_reload();
            break;
        case 'sshd':
            configd_run("sshd restart");
            break;
        case 'openvpn':
            $vpnmode = htmlspecialchars($extras['vpnmode']);
            if ($vpnmode == "server" || $vpnmode == "client") {
                $id = htmlspecialchars($extras['id']);
                $configfile = "/var/etc/openvpn/{$vpnmode}{$id}.conf";
                if (file_exists($configfile)) {
                    openvpn_restart_by_vpnid($vpnmode, $id);
                }
            }
            break;
        case 'relayd':
            relayd_configure(true);
            break;
        case 'squid':
            configd_run("proxy restart");
            break;
        case 'suricata':
            configd_run("ids restart");
            break;
        default:
            log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name));
            break;
    }
    return sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
}
开发者ID:8191,项目名称:opnsense-core,代码行数:68,代码来源:status_services.php


示例4: filter_configure

                            break;
                        }
                    }
                }
            }
            @unlink('/tmp/.vpn_pppoe.apply');
        }
        $retval = 0;
        $retval |= filter_configure();
        $savemsg = get_std_save_message($retval);
        clear_subsystem_dirty('vpnpppoe');
    }
}
if ($_GET['act'] == "del") {
    if ($a_pppoes[$_GET['id']]) {
        killbypid("/var/run/pppoe{$a_pppoes[$_GET['id']]['pppoeid']}-vpn.pid");
        mwexecf('/bin/rm -r %s', "/var/etc/pppoe{$a_pppoes[$_GET['id']]['pppoeid']}");
        unset($a_pppoes[$_GET['id']]);
        write_config();
        header("Location: vpn_pppoe.php");
        exit;
    }
}
$pgtitle = array(gettext("VPN"), gettext("PPPoE"));
$shortcut_section = "pppoes";
include "head.inc";
$main_buttons = array(array('label' => gettext("add a new pppoe instance"), 'href' => 'vpn_pppoe_edit.php'));
?>

<body>
	<?php 
开发者ID:hlcherub,项目名称:core,代码行数:31,代码来源:vpn_pppoe.php


示例5: install_cron_job

                    break;
                case 'weekly':
                    install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "*", "*", "0");
                    break;
                case 'monthly':
                    // fall through
                // fall through
                default:
                    install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "1", "*", "*");
            }
            $config['system']['bogons']['interval'] = $_POST['bogonsinterval'];
        }
        write_config();
        // Kill filterdns when value changes, filter_configure() will restart it
        if ($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval']) {
            killbypid('/var/run/filterdns.pid');
        }
        $retval = 0;
        $retval = filter_configure();
        if (stristr($retval, "error") != true) {
            $savemsg = get_std_save_message();
        } else {
            $savemsg = $retval;
        }
    }
}
$pgtitle = array(gettext("System"), gettext("Settings"), gettext("Firewall and NAT"));
include "head.inc";
?>

<body>
开发者ID:noikiy,项目名称:core-2,代码行数:31,代码来源:system_advanced_firewall.php


示例6: filter_configure

                        }
                    }
                }
            }
            @unlink("{$g['tmp_path']}/.vpn_pppoe.apply");
        }
        $retval = 0;
        $retval |= filter_configure();
        $savemsg = get_std_save_message($retval);
        clear_subsystem_dirty('vpnpppoe');
    }
}
if ($_GET['act'] == "del") {
    if ($a_pppoes[$_GET['id']]) {
        if ("{$g['varrun_path']}/pppoe" . $a_pppoes[$_GET['id']]['pppoeid'] . "-vpn.pid") {
            killbypid("{$g['varrun_path']}/pppoe" . $a_pppoes[$_GET['id']]['pppoeid'] . "-vpn.pid");
        }
        if (is_dir("{$g['varetc_path']}/pppoe" . $a_pppoes[$_GET['id']]['pppoeid'])) {
            mwexec("/bin/rm -r {$g['varetc_path']}/pppoe" . $a_pppoes[$_GET['id']]['pppoeid']);
        }
        unset($a_pppoes[$_GET['id']]);
        write_config();
        header("Location: services_pppoe.php");
        exit;
    }
}
$pgtitle = array(gettext("Services"), gettext("PPPoE Server"));
$shortcut_section = "pppoes";
include "head.inc";
if ($savemsg) {
    print_info_box($savemsg, 'success');
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:services_pppoe.php


示例7: unset

 $config['dhcpdv6'][$if]['tftp'] = $_POST['tftp'];
 $config['dhcpdv6'][$if]['ldap'] = $_POST['ldap'];
 $config['dhcpdv6'][$if]['netboot'] = $_POST['netboot'] ? true : false;
 $config['dhcpdv6'][$if]['bootfile_url'] = $_POST['bootfile_url'];
 $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime'];
 // Handle the custom options rowhelper
 if (isset($config['dhcpdv6'][$if]['numberoptions']['item'])) {
     unset($config['dhcpdv6'][$if]['numberoptions']['item']);
 }
 $config['dhcpdv6'][$if]['numberoptions'] = $numberoptions;
 write_config();
 $retval = 0;
 $retvaldhcp = 0;
 $retvaldns = 0;
 /* Stop DHCPv6 so we can cleanup leases */
 killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
 // dhcp_clean_leases();
 /* dnsmasq_configure calls dhcpd_configure */
 /* no need to restart dhcpd twice */
 if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
     $retvaldns = services_dnsmasq_configure();
     if ($retvaldns == 0) {
         clear_subsystem_dirty('hosts');
         clear_subsystem_dirty('staticmaps');
     }
 } else {
     if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
         $retvaldns = services_unbound_configure();
         if ($retvaldns == 0) {
             clear_subsystem_dirty('unbound');
             clear_subsystem_dirty('staticmaps');
开发者ID:dariomas,项目名称:pfsense,代码行数:31,代码来源:services_dhcpv6.php


示例8: unset

     }
     $config['dhcpdv6'][$if]['tftp'] = $_POST['tftp'];
     $config['dhcpdv6'][$if]['ldap'] = $_POST['ldap'];
     $config['dhcpdv6'][$if]['netboot'] = $_POST['netboot'] ? true : false;
     $config['dhcpdv6'][$if]['bootfile_url'] = $_POST['bootfile_url'];
     $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime'];
     // Handle the custom options rowhelper
     if (isset($config['dhcpdv6'][$if]['numberoptions']['item'])) {
         unset($config['dhcpdv6'][$if]['numberoptions']['item']);
     }
     $config['dhcpdv6'][$if]['numberoptions'] = $numberoptions;
     write_config();
 }
 if (!$input_errors || $_POST['apply'] == 'Apply changes') {
     /* Stop DHCPv6 so we can cleanup leases */
     killbypid("{$g['dhcpd_chroot_path']}/var/run/dhcpdv6.pid");
     // dhcp_clean_leases();
     /* dnsmasq_configure calls dhcpd_configure */
     /* no need to restart dhcpd twice */
     if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
         $retvaldns = services_dnsmasq_configure();
         if ($retvaldns == 0) {
             clear_subsystem_dirty('hosts');
             clear_subsystem_dirty('staticmaps');
         }
     } else {
         if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
             $retvaldns = services_unbound_configure();
             if ($retvaldns == 0) {
                 clear_subsystem_dirty('unbound');
             }
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:services_dhcpv6.php


示例9: killbyname

     killbyname("ntpd");
     break;
 case 'bsnmpd':
     killbypid("{$g['varrun_path']}/snmpd.pid");
     break;
 case 'choparp':
     killbyname("choparp");
     break;
 case 'dhcpd':
     killbyname("dhcpd");
     break;
 case 'dhcrelay':
     killbypid("{$g['varrun_path']}/dhcrelay.pid");
     break;
 case 'dnsmasq':
     killbypid("{$g['varrun_path']}/dnsmasq.pid");
     break;
 case 'miniupnpd':
     upnp_action('stop');
     break;
 case 'openntpd':
     killbyname("openntpd");
     break;
 case 'sshd':
     killbyname("sshd");
     break;
 case 'racoon':
     exec("killall -9 racoon");
 default:
     stop_service($_GET['service']);
     break;
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:status_services.php


示例10: upnp_action

            break;
        case 'miniupnpd':
            upnp_action('stop');
            break;
        case 'sshd':
            killbyname("sshd");
            break;
        case 'racoon':
            exec("killall -9 racoon");
            break;
        case 'openvpn':
            $vpnmode = $_GET['vpnmode'];
            if ($vpnmode == "server" or $vpnmode == "client") {
                $id = $_GET['id'];
                $pidfile = "{$g['varrun_path']}/openvpn_{$vpnmode}{$id}.pid";
                killbypid($pidfile);
            }
            break;
        case 'relayd':
            mwexec('pkill relayd');
            break;
        default:
            stop_service($_GET['service']);
            break;
    }
    $savemsg = sprintf(gettext("%s has been stopped."), htmlspecialchars($_GET['service']));
    sleep(5);
}
/* batch mode, allow other scripts to call this script */
if ($_GET['batch']) {
    exit;
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:status_services.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP killme函数代码示例发布时间:2022-05-15
下一篇:
PHP killbyname函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap