mongod doesn't return when killed

Bug #1675048 reported by Aaron Bentley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned

Bug Description

When jujud is killed, it is restarted. When mongod is killed, it stays dead.

Since mongod is crucial to jujud, it should presumably have the same lifecycle guarantees as jujud. Since juju installs mongo, it could ensure this.

$ juju bootstrap aws/us-west-2
Creating Juju controller "aws-us-west-2" on aws/us-west-2
Looking for packaged Juju agent version 2.1.2 for amd64
Launching controller instance(s) on aws/us-west-2...
 - i-03326174eaf9f2b7f (arch=amd64 mem=4G cores=2)
Fetching Juju GUI 2.4.4
Waiting for address
Attempting to connect to 34.208.16.131:22
Attempting to connect to 172.31.42.112:22
Logging to /var/log/cloud-init-output.log on the bootstrap machine
Running apt-get update
Running apt-get upgrade
Installing curl, cpu-checker, bridge-utils, cloud-utils, tmux
Fetching Juju agent version 2.1.2 for amd64
Installing Juju machine agent
Starting Juju machine agent (service jujud-machine-0)
Bootstrap agent now started
Contacting Juju controller at 172.31.42.112 to verify accessibility...
Bootstrap complete, "aws-us-west-2" controller now available.
Controller machines are in the "controller" model.
Initial model "default" added.
$ juju ssh -m controller 0
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-66-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.

*** System restart required ***
$ pgrep jujud
7503
$ sudo pkill jujud
$ pgrep jujud
7924
$ sudo pkill mongod
$ pgrep mongod

Revision history for this message
Tim Penhey (thumper) wrote :

Well... interesting.

Both of the services are set up the same. The difference is in the handling of SIGTERM (15). pkill sends SIGTERM by default. Juju returns non-zero, but mongo shuts down nicely and returns 0.

Both are set to restart on-failure in order to actually allow admins to shut them down.

If you use 'sudo pkill mongod -9' you will see it restart.

Changed in juju:
status: Triaged → Incomplete
Revision history for this message
Aaron Bentley (abentley) wrote :

@thumper I noticed they were set up the same, and was puzzled by the difference in behaviour. I suspect juju is wrong to exit nonzero when SIGTERMed. It may make sense to set both to restart=always, or maybe we're only worried about "non-clean" signals, i.e. those excluding "SIGHUP, SIGINT, SIGTERM or SIGPIPE"

@anastasia-macmood, what information do you need?

Revision history for this message
Tim Penhey (thumper) wrote :

Aaron, I think you are right in that Juju should not exit with a non-zero when dealing with SIGTERM.

Changed in juju:
status: Incomplete → Triaged
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 5 years, so we're marking it Expired. If you believe this is incorrect, please update the status.

Changed in juju:
status: Triaged → Expired
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.