问题 最近总有开发小伙伴来找我,为什么我的容器总退出呢,在哪能看到原因。故写篇文章整理下docker退出的状态码。
最近总有开发小伙伴来找我,为什么我的容器总退出呢,在哪能看到原因。故写篇文章整理下docker退出的状态码。
一键领取预热专享618元代金券,2核2G云服务器爆品秒杀低至18元!云产品首单低0.8折起,企业用户购买域名1元起…
使用 kubectl describe pod 查看异常的 pod 的状态,在容器列表里看 State 字段,其中 ExitCode 即程序退出时的状态码,正常退出时为0。 [exitcode-pod] 退出状态码的区间 必须在 0-255 之间 0 表示正常退出 外界中断将程序退出的时候状态码区间在 129-255,(操作系统给程序发送中断信号,比如 kill -9 是
使用 kubectl describe pod 查看异常的 pod 的状态,在容器列表里看 State 字段,其中 ExitCode 即程序退出时的状态码,正常退出时为0。
1492146520853_0005 failed 2 times due to AM Container for appattempt_1492146520853_0005_000002 exited with exitCode Container id: container_1492146520853_0005_02_000001 Exit code: 127 Stack trace: ExitCodeException exitCode
org.apache.hadoop.hdfs.server.datanode.DataNode: Invalid dfs.datanode.data.dir /ray/hadoop/dfs/data : ExitCodeException exitCode
= 0 while True: if p.poll() is not None: res = p.communicate() exitcode = p.poll() if p.poll() else 0 return res[0], exitcode, res[1] seconds_passed = time.time = 0 while True: if p.poll() is not None: res = p.communicate() exitcode = p.poll() if p.poll() else 0 return res[0], exitcode, res[1] seconds_passed = time.time , err = '', 128, '执行系统命令超时' return out, exitcode, err time.sleep(0.1)
/usr/bin/env bash set -e EXITCODE=0 # bits of this were adapted from lxc-checkconfig # see also https fi EXITCODE=1 echo " $(wrap_color '(see https://github.com/tianon/cgroupfs-mount)' yellow)" fi 's/^/ /' check_flags BTRFS_FS_POSIX_ACL | sed 's/^/ /' [ "$EXITCODE" = 0 ] && STORAGE=0 EXITCODE | sed 's/^/ /' [ "$EXITCODE" = 0 ] && STORAGE=0 EXITCODE=0 echo " - \"$(wrap_color 'zfs' blue)\" " = 0 ] && STORAGE=0 EXITCODE=0 EXITCODE=$CODE [ "$STORAGE" = 1 ] && EXITCODE=1 echo check_limit_over
SSH command execution finished host=master.hadoop, exitcode=0 Command end time 2018-11-27 22:13:32 = Command start time 2018-11-27 22:13:32 scp /var/lib/ambari-server/ambari-sudo.sh host=master.hadoop, exitcode SSH command execution finished host=master.hadoop, exitcode=0 Command end time 2018-11-27 22:13:32 = SSH command execution finished host=master.hadoop, exitcode=0 Command end time 2018-11-27 22:13:33 = SSH command execution finished host=master.hadoop, exitcode=0 Command end time 2018-11-27 22:13:33 =
server({port:1367},null); _server.start(); //runner.run会在运行完成后,立即结束自己 runner.run({port:1367},function(exitCode ){ console.log('karma stop code:' + exitCode); process.exit(exitCode); }); //结束自己现有的 var time = setTimeout(function(){ stop.stop({port:1367},function(exitCode){ console.log('programe exit: ' + exitCode); process.exit(exitCode); }); },5000); 三、让他成为fis的插件 1.由于fis工程有多个注入口,对于单元测试暂定放在打包之前
在 windows 应用程序关闭的时候可以通过进程的 ExitCode 了解这个应用是如何关闭的 因为所有的应用都可以自己定义应用关闭的 ExitCode 所以如果应用是自己开发的,那么可以通过 ExitCode 这时软件拿到的是 ExitCode 是 1073807364 (0x40010004) 这个值相当于 -1073741510 (0xc000013a) 表示应用程序是在系统关闭的时候关闭,或者软件收到了 也有找到某个应用程序里面越界访问被系统关闭也是 -1073741510 所以通过这个值判断是关机也是不对的 当前用户也可以自己设置 ExitCode 为 1073807364 所以如果不是自己写的程序, 通过这个方式判断第三方程序的关闭是否是在系统关闭是不一定 其他的 ExitCode 请看 System Error Codes Exit code 1073807364 (0x40010004) - BOINC
[]) { int c, i; // 重要的数据结构1 struct wpa_interface *ifaces, *iface; int iface_count, exitcode = 0; goto out; } } exitcode = 0; //主要函数1 : 创建并初始化一个global global == 0) exitcode = wpa_supplicant_init_match(global); #endif /* CONFIG_MATCH_IFACE */ // 启动, wpa_supplicant 通过epoll 方式实现多路I/O复用 if (exitcode == 0) exitcode = wpa_supplicant_run(global #endif /* CONFIG_MATCH_IFACE */ os_free(params.pid_file); os_program_deinit(); return exitcode
i<num_remote_hosts_ip; ++i) { bool color = true; int num_bytes = 0; int exitcode password, mooon::argument::t->value()); libssh2.remotely_execute(commands, std::cout, &exitcode fprintf(stdout, PRINT_COLOR_NONE); color = false; // color = true; if ((0 == exitcode = 0) { fprintf(stderr, "%d: %s\n", exitcode, mooon::sys::Error::to_string (exitcode).c_str()); } else if (!
php namespace app\commands; use YII; use yii\console\Controller; use yii\console\ExitCode; use yii\ actionTest1() { echo $this- param1, ' ', $this- param2, ' ', $this- param3, "\n"; return ExitCode function actionTest2($p1 = '', $p2 = '', $p3 = '') { echo $p1, ' ', $p2, ' ', $p3, "\n"; return ExitCode ,bb,cc public function actionTest3(array $arr) { echo implode('--', $arr), "\n"; return ExitCode , Console::FG_BLUE); echo $hello, ' ', $world, ' ', $sigh, "\n"; return ExitCode::OK; } } 运行结果如下
System.currentTimeMillis() - startTime, exitCode); } if(exitCode ! = 0) { throw new ShellProcessExecException(exitCode, "进程返回异常信息 , returnCode:" + exitCode + ", lastError:" + getProcessLastError()); = p.exitValue(); log.info("【cli】process costTime:{}ms, exitCode:{}", System.currentTimeMillis() - startTime, exitCode); } if(exitCode !
设置该属性必须在start()之前; 6.name — 进程名称; 7.pid— 进程ID标识,pid,值得注意的是:如果在start函数之前获取pid默认为None,因为进程还未创建,获取不到pid; 8.exitcode _name__ == "__main__": main() 输出结果: 进程process pid = 2600 进程process name = Process-1 进程process exitcode = None 进程process pid = 4372 进程process name = Process-2 进程process exitcode = None 进程process pid = 14124 进程process name = Process-3 进程process exitcode = None 进程process pid = 10920 进程process name = Process-4 进程process exitcode = None 进程process pid = 4892 进程process name = Process-5 进程process exitcode
CLoginTokener一起使用:#include <mooon/utils/tokener.h> // // 使用示例(执行远程命令): // try // { // int exitcode CLibssh2 libssh2(ip, port, username, password); // libssh2.remotely_execute(command, std::cout, &exitcode sys::CSyscallException); ~CLibssh2(); // command 被远程执行的命令,如:whoami // out 接收命令输出的流 // exitcode num_bytes 远程命令吐出的字节数 void remotely_execute(const std::string& command, std::ostream& out, int* exitcode
ShellProcess::run() { QString ip; //依次扫描Ip列表中的各个IP foreach( ip, ipRange ) { int exitCode endl; #ifdef Q_OS_WIN QString strArg = "ping " + ip + " -n 1 -i 2"; exitCode = QProcess::execute(strArg); #else //其他平台(Linux或Mac) exitCode = QProcess ::execute("ping", QStringList() << "-c 1" << "-t 2" << ip)); #endif if(0 == exitCode
= Artisan::call('migrate:refresh', ['--database' => $database]); $this->assertEquals(0, $exitCode ); $exitCode = Artisan::call('migrate:rollback', ['--database' => $database]); $this->assertEquals (0, $exitCode); $exitCode = Artisan::call('migrate', ['--database' => $database]); $this->assertEquals (0, $exitCode); $exitCode = Artisan::call('db:seed', ['--database' => $database]); $this->assertEquals (0, $exitCode); } 在测试中使用 Artisan 命令或许不是最佳的设计模式,但他只是测试任何 web 应用中最重要的功能之一。
1542706493784_0005 failed 2 times due to AM Container for appattempt_1542706493784_0005_000002 exited with exitCode attempt.Diagnostics: [2018-11-20 17:48:05.088]Application application_1542706493784_0005 initialization failed (exitCode
云端获取和启用云服务器,并实时扩展或缩减云计算资源。云服务器 支持按实际使用的资源计费,可以为您节约计算成本。 腾讯云服务器(CVM)为您提供安全可靠的弹性云计算服务。只需几分钟,您就可以在云端获取和启用云服务器,并实时扩展或缩减云计算资源。云服务器 支持按实际使用的资源计费,可以为您节约计算成本。
扫码关注云+社区
领取腾讯云代金券