[PATCH lkp-tests] fix(lkp-bootstrap.servce):$GOCACHE is not defined with jobs that use go-lang

The lkp-bootstrap.service runs before login, and it's environment variables is not completely full.The jobs run with go-lang can't get $GOCACHE and $HOME, will prompt errors like below: build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined make: *** [Makefile:34: runc] Error 1 ==> ERROR: A failure occurred in build(). Aborting... Signed-off-by: Zhou Shengrui <zhoushengrui@qq.com> --- rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service index 50320140..92e7e5ee 100644 --- a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service +++ b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service @@ -5,7 +5,7 @@ After=network.target [Service] Type=forking -ExecStart=/etc/init.d/lkp-bootstrap +ExecStart=su -c /etc/init.d/lkp-bootstrap IgnoreSIGPIPE=no KillMode=none TasksMax=infinity -- 2.23.0

On Tue, Oct 13, 2020 at 09:54:23AM +0800, Zhou Shengrui wrote:
The lkp-bootstrap.service runs before login, and it's environment variables is not completely full.The jobs run with go-lang can't get $GOCACHE and $HOME, will prompt errors like below:
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined make: *** [Makefile:34: runc] Error 1 ==> ERROR: A failure occurred in build(). Aborting...
Signed-off-by: Zhou Shengrui <zhoushengrui@qq.com> --- rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service index 50320140..92e7e5ee 100644 --- a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service +++ b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service @@ -5,7 +5,7 @@ After=network.target
[Service] Type=forking -ExecStart=/etc/init.d/lkp-bootstrap +ExecStart=su -c /etc/init.d/lkp-bootstrap
This change let centos initromfs image can't start lkp-bootstrap service. Need to find a better way. Welcome to CentOS Linux 7 (AltArch)! [/etc/systemd/system/../../../usr/lib/systemd/system/lkp-bootstrap.service:8] Executable path is not absolute, ignoring: su -c /etc/init.d/lkp-bootstrap lkp-bootstrap.service lacks both ExecStart= and ExecStop= setting. Refusing. Cannot add dependency job for unit lkp-bootstrap.service, ignoring: Unit is not loaded properly: Invalid argument. [ OK ] Reached target Swap. Thanks, Chenglong
IgnoreSIGPIPE=no KillMode=none TasksMax=infinity -- 2.23.0

Make use of Environment? [Service] Environment="FOO=bar baz" ExecStart=/bin/myforegroundcmd Thanks, Fengguang On Thu, Oct 15, 2020 at 02:11:39PM +0800, Wang Chenglong wrote:
On Tue, Oct 13, 2020 at 09:54:23AM +0800, Zhou Shengrui wrote:
The lkp-bootstrap.service runs before login, and it's environment variables is not completely full.The jobs run with go-lang can't get $GOCACHE and $HOME, will prompt errors like below:
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined make: *** [Makefile:34: runc] Error 1 ==> ERROR: A failure occurred in build(). Aborting...
Signed-off-by: Zhou Shengrui <zhoushengrui@qq.com> --- rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service index 50320140..92e7e5ee 100644 --- a/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service +++ b/rootfs/addon/usr/lib/systemd/system/lkp-bootstrap.service @@ -5,7 +5,7 @@ After=network.target
[Service] Type=forking -ExecStart=/etc/init.d/lkp-bootstrap +ExecStart=su -c /etc/init.d/lkp-bootstrap
This change let centos initromfs image can't start lkp-bootstrap service. Need to find a better way.
Welcome to CentOS Linux 7 (AltArch)!
[/etc/systemd/system/../../../usr/lib/systemd/system/lkp-bootstrap.service:8] Executable path is not absolute, ignoring: su -c /etc/init.d/lkp-bootstrap lkp-bootstrap.service lacks both ExecStart= and ExecStop= setting. Refusing. Cannot add dependency job for unit lkp-bootstrap.service, ignoring: Unit is not loaded properly: Invalid argument. [ OK ] Reached target Swap.
Thanks, Chenglong
IgnoreSIGPIPE=no KillMode=none TasksMax=infinity -- 2.23.0
participants (3)
-
Wang Chenglong
-
Wu Fengguang
-
Zhou Shengrui