handler->state = state;
TRACE("Set container state to %s", lxc_state2str(state));
- process_lock();
if (lxc_list_empty(&handler->state_clients)) {
TRACE("No state clients registered");
process_unlock();
*/
lxc_monitor_send_state(name, STOPPED, handler->lxcpath);
- if (handler->conf->reboot == 0) {
- /* For all new state clients simply close the command socket.
- * This will inform all state clients that the container is
- * STOPPED and also prevents a race between a open()/close() on
- * the command socket causing a new process to get ECONNREFUSED
- * because we haven't yet closed the command socket.
- */
- close(handler->conf->maincmd_fd);
- handler->conf->maincmd_fd = -1;
- } else {
- lxc_set_state(name, handler, STOPPED);
- }
+ /* For all new state clients simply close the command socket. This will
+ * inform all state clients that the container is STOPPED and also
+ * prevents a race between a open()/close() on the command socket
+ * causing a new process to get ECONNREFUSED because we haven't yet
+ * closed the command socket.
+ */
+ close(handler->conf->maincmd_fd);
+ handler->conf->maincmd_fd = -1;
if (run_lxc_hooks(name, "post-stop", handler->conf, handler->lxcpath, NULL)) {
ERROR("Failed to run lxc.hook.post-stop for container \"%s\".", name);