[lxc-devel] [lxc/lxc] aa4604: start: add lxc_init_handler()

GitHub noreply at github.com
Tue Jun 13 05:34:48 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: aa460476ad3a2e06747da3bfe2c7eb24ea084512
      https://github.com/lxc/lxc/commit/aa460476ad3a2e06747da3bfe2c7eb24ea084512
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/criu.c
    M src/lxc/execute.c
    M src/lxc/lxc.h
    M src/lxc/lxccontainer.c
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/state.c
    M src/lxc/tools/lxc_execute.c

  Log Message:
  -----------
  start: add lxc_init_handler()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 85ff0e3ee2b42b94ee18757678c771c285d732da
      https://github.com/lxc/lxc/commit/85ff0e3ee2b42b94ee18757678c771c285d732da
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  lxccontainer: only spawn monitord on demand

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 3f903c04fea9e59c2057defd8e906d20199b7203
      https://github.com/lxc/lxc/commit/3f903c04fea9e59c2057defd8e906d20199b7203
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/commands.c
    M src/lxc/start.c

  Log Message:
  -----------
  commands: add TRACE()ers

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: dbc9832d217d812f68184cc431bfc5ac559e5dfa
      https://github.com/lxc/lxc/commit/dbc9832d217d812f68184cc431bfc5ac559e5dfa
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/commands.c
    M src/lxc/commands.h
    M src/lxc/lxccontainer.c
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/state.c
    M src/lxc/state.h

  Log Message:
  -----------
  commands: add lxc_cmd_state_server()

A LXC container's lifecycle is regulated by the states STARTING, RUNNING,
STOPPING, STOPPED, ABORTING. These states are tracked in the LXC handler and
can be checked via approriate functions in the command socket callback system.
(The freezer stages are not part of a container's lifecycle since they are not
recorded in the LXC handler. This might change in the future but given that the
freezer controller will be removed from future cgroup implementations it is
unlikely.) So far, LXC was using an external helper to track the states of a
container (lxc-monitord). This solution was error prone. For example, the
external state server would hang in various scenarios that seemed to be caused
by either very subtle internal races or irritation of the external state server
by signals.

LXC will switch from an external state monitor (lxc-monitord) which serves as a
state server for state clients to a native implementation using the indiviual
container's command socket. This solution was discussed and outlined by Stéphane
Graber and Christian Brauner during a LX{C,D} sprint.

The LXC handler will gain an additional field to track state clients. In order
for a state client to receive state notifications from the command server he
will need to register himself via the lxc_cmd_state_server() function in the
state client list. The state client list will be served by lxc_set_state()
during the container's lifecycle. lxc_set_state() will also take care of
removing any clients from the state list in the LXC handler once the requested
state has been reached and sent to the client.
In order to prevent races between adding and serving new state clients the state
client list and the state field in the LXC handler will be protected by a lock.

This commit effectively deprecates lxc-monitord. Instead of serving states to
state clients via the lxc-monitord fifo and socket we will now send the state
of the container via the container's command socket.
lxc-monitord is still useable and will - for the sake of the lxc-monitor
command - be kept around so that non-API state clients can still monitor the
container during it's lifecycle.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: f2e07cb6a4def116c5e2ab4027d15c196785228a
      https://github.com/lxc/lxc/commit/f2e07cb6a4def116c5e2ab4027d15c196785228a
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/lxccontainer.c
    M src/lxc/start.c
    M src/lxc/start.h

  Log Message:
  -----------
  {start,lxccontainer}: add lxc_free_handler()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: c47eafecc6269d7bde8948f9447b9ab03564dad3
      https://github.com/lxc/lxc/commit/c47eafecc6269d7bde8948f9447b9ab03564dad3
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  lxccontainer: cleanup + bugfixes

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: bbdbf8f078319cdeea69ad43866446c59496d430
      https://github.com/lxc/lxc/commit/bbdbf8f078319cdeea69ad43866446c59496d430
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  conf: fix wrong path on overlayfs

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: d0ab6d91c9a4a696d32cce7dc5d156e170af60a3
      https://github.com/lxc/lxc/commit/d0ab6d91c9a4a696d32cce7dc5d156e170af60a3
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/tests/lxc-test-apparmor-mount
    M src/tests/lxc-test-unpriv

  Log Message:
  -----------
  tests: don't fail when no processes for user exist

Since we kicked lxc-monitord there will very likely be no user processes around
anymore after all container's have been stopped. Which is a very very very good
thing. So let's not error out when pkill doesn't find any processes.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 74f04141311978913432d2a221510e9a75b65ca6
      https://github.com/lxc/lxc/commit/74f04141311978913432d2a221510e9a75b65ca6
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M src/lxc/commands.c
    M src/lxc/commands.h
    M src/lxc/conf.c
    M src/lxc/criu.c
    M src/lxc/execute.c
    M src/lxc/lxc.h
    M src/lxc/lxccontainer.c
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/state.c
    M src/lxc/state.h
    M src/lxc/tools/lxc_execute.c
    M src/tests/lxc-test-apparmor-mount
    M src/tests/lxc-test-unpriv

  Log Message:
  -----------
  Merge pull request #1618 from brauner/2017-06-06/kill_lxc_monitord

start: kill lxc-monitord


Compare: https://github.com/lxc/lxc/compare/46d9789ccae0...74f041413119


More information about the lxc-devel mailing list