惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

ncc的个人网站

MCSManager 数据备份与迁移实践 Goland Update Delve frp反向代理群晖WebDAV服务器 1panel安装的Mysql版本从5.7升级到8.4.5 备份mc服务器脚本 威联通使用screen报错 Cannot find terminfo entry for 'screen.linux' Brew No Available Formula Gitea迁移和SSH容器直通 QQ邮箱文件夹重新开启通知 将博客从Typecho迁移到Hugo
Act_runner 使用 supervisor 启动无法正常识别到 asdf 设置的环境问题(二)
FGHWETT · 2024-11-11 · via ncc的个人网站

注意

本文最后更新于 2025-04-29,文中内容可能已过时。

一年前,我碰到了使用supervisor启动act_runner工作不正常的问题。那时候,我通过设置supervisor启动时的环境变量解决了这一问题。

Act_runner 使用 supervisor 启动无法正常识别到 asdf 设置的环境问题 155.html

但是这并不优雅,于是在这几天整理服务器时,我重新研究了一下。

由于act_runner依赖命令启动目录下的.runner文件,所以我将二进制文件和对应的启动配置文件全部放在了/opt/app/act_runner文件夹下。对应的配置文件也就配置成了二进制文件所在的目录,使用1panel自动生成的配置如下。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[program:act_runner]
command                 = /opt/app/act_runner/act_runner daemon
directory               = /opt/app/act_runner
autorestart             = true
startsecs               = 3
stdout_logfile          = /opt/1panel/tools/supervisord/log/act_runner.out.log
stderr_logfile          = /opt/1panel/tools/supervisord/log/act_runner.err.log
stdout_logfile_maxbytes = 2MB
stderr_logfile_maxbytes = 2MB
user                    = root
priority                = 999
numprocs                = 1
process_name            = %(program_name)s_%(process_num)02d

此时,如果使用这个runner执行命令的话就会发现报错了。

1
bash: .cache/act/3aceed1a0da43919/act/workflow/0.sh: No such file or directory

理论上supervisor也是用root权限启动的,所以不会出现文件写入失败的问题。于是,在我对比了两次运行的环境变量之后,我发现直接运行act_runner所跑的任务都是在/root/.cache/...下跑的,而supervisor启动的任务都是在.cache/...下运行的,并且环境变量少了HOME=/root,于是我推测,可能是act_runner用到了这一环境变量。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[program:act_runner]
command                 = /opt/app/act_runner/act_runner daemon
directory               = /opt/app/act_runner
autorestart             = true
startsecs               = 3
stdout_logfile          = /opt/1panel/tools/supervisord/log/act_runner.out.log
stderr_logfile          = /opt/1panel/tools/supervisord/log/act_runner.err.log
stdout_logfile_maxbytes = 2MB
stderr_logfile_maxbytes = 2MB
user                    = root
priority                = 999
numprocs                = 1
process_name            = %(program_name)s_%(process_num)02d
environment=HOME="/root"

于是,在我设置了环境变量之后,上面的问题也就没出现了。

asdf环境不生效问题

虽然解决了命令执行失败的问题解决了,但是涉及到单独设置的环境变量还是没有。因此,还需要添加对应的环境变量。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[program:act_runner]
command                 = /opt/app/act_runner/act_runner daemon
directory               = /opt/app/act_runner
autorestart             = true
startsecs               = 3
stdout_logfile          = /opt/1panel/tools/supervisord/log/act_runner.out.log
stderr_logfile          = /opt/1panel/tools/supervisord/log/act_runner.err.log
stdout_logfile_maxbytes = 2MB
stderr_logfile_maxbytes = 2MB
user                    = root
priority                = 999
numprocs                = 1
process_name            = %(program_name)s_%(process_num)02d
environment=HOME="/root",PATH="/root/.asdf/shims:/root/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",ASDF_DIR="/root/.asdf"

2025-04-29更新:asdf升级到v0.16.0的版本后,所需要的环境变量也需要同时更改一下。

1
environment=HOME="/root",PATH="/root/.asdf/shims:/root/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/$HOME/bin",ASDF_DATA_DIR="/root/.asdf"