前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >tcsetpgrp failed重新编译tini

tcsetpgrp failed重新编译tini

作者头像
runzhliu
发布2020-08-06 10:45:00
1.1K0
发布2020-08-06 10:45:00
举报
文章被收录于专栏:容器计算

1 Overview

在启动 Spark Operator 的时候出现了一个意想不到的问题。

代码语言:javascript
复制
[root@sholdmix01node1 /data/runzhliu/spark]# kubectl log  -n kube-system spark-sparkoperator-86f6c889cd-ggbmc
log is DEPRECATED and will be removed in a future version. Use logs instead.
++ id -u
+ myuid=185
++ id -g
+ mygid=0
+ set +e
++ getent passwd 185
+ uidentry=
+ set -e
+ echo 185
185
0

+ echo 0
+ echo
+ [[ -z '' ]]
+ [[ -w /etc/passwd ]]
+ echo '185:x:185:0:anonymous uid:/opt/spark:/bin/false'
+ exec /usr/bin/tini -s -- /usr/bin/spark-operator
[FATAL tini (9)] tcsetpgrp failed: Permission denied

因为本人在腾讯,这是因为开发环境的 tlinux 的问题,导致 tini 出错了。寻找了很久,也没找到 特别有效的信息,于是查看一下 tini 的源码,看看 这个 错误是如何产生的。

2 tini 源码

大家可以看到这行代码,错误信息就是由他打印的。

代码语言:javascript
复制
// Doing it in the child process avoids a race condition scenario
// if Tini is calling Tini (in which case the grandparent may make the
// parent the foreground process group, and the actual child ends up...
// in the background!)
if (tcsetpgrp(STDIN_FILENO, getpgrp())) {
	if (errno == ENOTTY) {
		PRINT_DEBUG("tcsetpgrp failed: no tty (ok to proceed)");
	} else if (errno == ENXIO) {
		// can occur on lx-branded zones
		PRINT_DEBUG("tcsetpgrp failed: no such device (ok to proceed)");
	} else {
		PRINT_FATAL("tcsetpgrp failed: %s", strerror(errno));
		return 1;
	}
}

可以直接把这段代码注释掉,然后重新编译 cmake . && make

3 Summary

将重新编译后的 tini 替换原来镜像的 tini 即可。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/05/12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1 Overview
  • 2 tini 源码
  • 3 Summary
相关产品与服务
TencentOS Server
TencentOS Server 是腾讯云推出的 Linux 操作系统,它旨在为云上运行的应用程序提供稳定、安全和高性能的执行环境。它可以运行在腾讯云 CVM 全规格实例上,包括黑石物理服务器2.0。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档