Skip to content

running_in_container function in gorouter_ctl does not work properly #138

@sravankumar777

Description

@sravankumar777

Thanks for submitting an issue to routing-release. We are always trying to improve! To help us, please fill out the following template.

Issue

While gorouter_ctl is initiated/started, gorouter_ctl does not configure the /proc/sys/net/ipv4 parameters.

Context

Performing stemcell version upgrade on platform.

Current using Stemcell Version: Ubuntu Trusty v3586.60
Plan to update Stemcell Version: Ubuntu Xenial v170.25

Steps to Reproduce

  1. Routing-release version used: 0.170.0
  2. Stop gorouter_ctl using sudo /var/vcap/jobs/gorouter/bin/gorouter_ctl stop
  3. Start gorouter_ctl using sudo /var/vcap/jobs/gorouter/bin/gorouter_ctl start

With latest stemcell version v170.25,

cat /var/vcap/bosh/etc/stemcell_version
170.25
$ source /var/vcap/packages/routing_utils/pid_utils.sh
$ running_in_container && echo "IN CONTAINER" || echo "NOT IN CONTAINER"
IN CONTAINER

# grep --quiet --invert-match ':/$' /proc/self/cgroup; echo $?
0

With previous stemcell version v3586.60

cat /var/vcap/bosh/etc/stemcell_version
3586.60

$ source /var/vcap/packages/routing_utils/pid_utils.sh

running_in_container && echo "IN CONTAINER" || echo "NOT IN CONTAINER"
NOT IN CONTAINER

grep --quiet --invert-match ':/$' /proc/self/cgroup; echo $?
1

Expected result

Function running_in_container defined in pid_utils should provide correct output based on the running of process.
grep --quiet --invert-match ':/$' /proc/self/cgroup should be properly checking about the /proc/self/cgroup services.

Current result

After updating the Ubuntu Xenial stemcell, running_container function always returns that process is running inside a container.

$ sudo /var/vcap/jobs/gorouter/bin/gorouter_ctl start
------------ STARTING gorouter_ctl at Tue Feb 26 00:45:34 UTC 2019 --------------
Not setting /proc/sys/net/ipv4 parameters, since I'm running inside a linux container

Possible Fix

grep --quiet --invert-match ':/$' /proc/self/cgroup should be handled properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions