Revert "Added changes related to control groups"

This reverts commit f093129b32.

Reason for revert: This is breaking all airshipctl and treasuremap gate runner job. The issue is that, the services added here creates some dependency to time sync and few other services and due to which cloud init is stuck in running state forever. Please fix this issue and update a new PS with dependencies resolved.

root@ephemeral:/var/log# cloud-init status
status: running
root@ephemeral:/var/log# systemctl list-jobs
JOB UNIT                                 TYPE  STATE
69  xfs_scrub_all.timer                  start waiting
115 docker.service                       start running
80  systemd-update-utmp-runlevel.service start waiting
119 cloud-init.target                    start waiting
66  man-db.timer                         start waiting
73  fstrim.timer                         start waiting
112 hanging-cgroup-release.service       start waiting
3   graphical.target                     start waiting
19  time-sync.target                     start waiting
126 cloud-final.service                  start waiting
4   multi-user.target                    start waiting
64  timers.target                        start waiting
67  e2scrub_all.timer                    start waiting
65  logrotate.timer                      start waiting
127 hanging-cgroup-release.timer         start waiting
70  apt-daily-upgrade.timer              start waiting
68  motd-news.timer                      start waiting
18  systemd-time-wait-sync.service       start running
72  apt-daily.timer                      start waiting

Change-Id: I4eb5700d7f10861380be71c584cecfe9b48f965f
This commit is contained in:
Sirajudeen 2021-06-22 22:48:25 +00:00
parent f093129b32
commit b4a10949b6
2 changed files with 0 additions and 72 deletions

View File

@ -1,69 +0,0 @@
- name: hanging-cgroup-release.sh
copy:
dest: '/opt/hanging-cgroup-release.sh'
content: |
#!/bin/bash
set -ex
set -o pipefail
cgroup_count() {
echo "Current cgroup count: $(find /sys/fs/cgroup/*/system.slice -name tasks | wc -l)"
}
DATE=$(date)
echo "$(cgroup_count)"
echo # Stop systemd mount unit that isn't actually mounted
echo "Stopping Kubernetes systemd mount units that are not mounted to the system."
echo "sed extracts systemd output to just be the unit ($1) and the mountpoint ($2)."
echo "1st xargs filters it by test -d $2 || echo $1."
echo "2nd xargs removes the entries ($1) one by one."
systemctl list-units --state=running | \
sed -rn '/Kubernetes.transient.mount/s,(run-\S+).+(/var/lib/kubelet/pods/.+),\1 \2,p' | \
xargs -r -l1 sh -c 'test -d $2 || echo $1' -- | \
xargs -r -tl1 systemctl stop |& wc -l
echo "$(cgroup_count)"
owner: root
group: root
mode: '0755'
- name: hanging-cgroup-release.service
copy:
dest: '/etc/systemd/system/hanging-cgroup-release.service'
content: |
[Unit]
Description=hanging-cgroup-release service
After=network.target
[Service]
ExecStart=/opt/hanging-cgroup-release.sh
[Install]
WantedBy=multi-user.target
owner: root
group: root
mode: '0644'
- name: start-cgroup-service
systemd:
name: hanging-cgroup-release.service
enabled: yes
- name: hanging-cgroup-release.timer
copy:
dest: '/etc/systemd/system/hanging-cgroup-release.timer'
content: |
[Unit]
Description=10min Timer Target
Requires=hanging-cgroup-release.service
After=network.target
[Timer]
Unit=hanging-cgroup-release.service
OnCalendar=*:0/10
[Install]
WantedBy=multi-user.target
owner: root
group: root
mode: '0644'
- name: start-cgroup-timer
systemd:
name: hanging-cgroup-release.timer
enabled: yes

View File

@ -46,9 +46,6 @@
- name: "fetch url resource" - name: "fetch url resource"
include_tasks: fetch-from-url.yaml include_tasks: fetch-from-url.yaml
when: run_context == default_run_context when: run_context == default_run_context
- name: "cgroup count"
include_tasks: hanging-cgroup-release.yaml
when: run_context == default_run_context
# Context-dependent tasks # Context-dependent tasks
- name: "write user-provided files" - name: "write user-provided files"