@@ -739,24 +739,7 @@ jobs:
739739 # selinux and systemd headers needed to build tests
740740 sudo apt-get -y update
741741 sudo apt-get -y install libselinux1-dev libsystemd-dev
742- # pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
743- # In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands, and "system boot" entry is missing.
744- # The account also has empty gecos fields.
745- # To work around these issues for pinky (and who) tests, we create a fake utmp file with a
746- # system boot entry and a login entry for the GH runner account.
747- printf '%s\n%s\n%s' \
748- '[2] [00000] [~~ ] [reboot ] [~ ] [6.0.0-test ] [0.0.0.0 ] [2022-02-22T22:11:22,222222+0000]' \
749- '[7] [999999] [tty2] [runner ] [tty2 ] [ ] [0.0.0.0 ] [2022-02-22T22:22:22,222222+0000]' \
750- '[7] [00001] [tty3] [runner ] [tty3 ] [ ] [0.0.0.0 ] [2022-02-22T22:22:22,222222+0000]' \
751- | sudo utmpdump -r -o /var/run/utmp
752- # ... and add a full name to each account with a gecos field but no full name.
753- sudo sed -i 's/:,/:runner name,/' /etc/passwd
754- # We also create a couple optional files pinky looks for
755- touch /home/runner/.project
756- echo "foo" > /home/runner/.plan
757- # add user with digital username for testing with issue #7787
758- echo 200:x:2000:2000::/home/200:/bin/bash | sudo tee -a /etc/passwd
759- echo 200:x:2000: | sudo tee -a /etc/group
742+ bash util/setup-gh-runner-utmp.sh
760743 ;;
761744 esac
762745 - uses : taiki-e/install-action@v2
@@ -1104,24 +1087,7 @@ jobs:
11041087 # selinux and systemd headers needed to build tests
11051088 sudo apt-get -y update
11061089 sudo apt-get -y install libselinux1-dev libsystemd-dev
1107- # pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
1108- # In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands, and "system boot" entry is missing.
1109- # The account also has empty gecos fields.
1110- # To work around these issues for pinky (and who) tests, we create a fake utmp file with a
1111- # system boot entry and a login entry for the GH runner account.
1112- printf '%s\n%s\n%s' \
1113- '[2] [00000] [~~ ] [reboot ] [~ ] [6.0.0-test ] [0.0.0.0 ] [2022-02-22T22:11:22,222222+0000]' \
1114- '[7] [999999] [tty2] [runner ] [tty2 ] [ ] [0.0.0.0 ] [2022-02-22T22:22:22,222222+0000]' \
1115- '[7] [00001] [tty3] [runner ] [tty3 ] [ ] [0.0.0.0 ] [2022-02-22T22:22:22,222222+0000]' \
1116- | sudo utmpdump -r -o /var/run/utmp
1117- # ... and add a full name to each account with a gecos field but no full name.
1118- sudo sed -i 's/:,/:runner name,/' /etc/passwd
1119- # We also create a couple optional files pinky looks for
1120- touch /home/runner/.project
1121- echo "foo" > /home/runner/.plan
1122- # add user with digital username for testing with issue #7787
1123- echo 200:x:2000:2000::/home/200:/bin/bash | sudo tee -a /etc/passwd
1124- echo 200:x:2000: | sudo tee -a /etc/group
1090+ bash util/setup-gh-runner-utmp.sh
11251091 ;;
11261092 esac
11271093
0 commit comments