Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new pstree consumption #1470

Merged
merged 3 commits into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ issues/
.github/
website/
*.md
Dockerfile
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Ubuntu Node.js Dockerfile
#
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
# https://docs.docker.com/examples/nodejs_web_app/
#

# Pull base image.
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y curl locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8

# Install Node.js
RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install --yes nodejs build-essential

# Install app dependencies
RUN npm install -g npx

# Bundle app source
# Trouble with COPY http://stackoverflow.com/a/30405787/2926832
# COPY . /src

WORKDIR /src


# Binds to port 8080
# EXPOSE 8080

# Defines your runtime(define default command)
# These commands unlike RUN (they are carried out in the construction of the container) are run when the container
#CMD ["node", "/src/http.js"]
4 changes: 2 additions & 2 deletions lib/monitor/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ function kill(child, signal, callback) {
const sig = signal.replace('SIG', '');
psTree(child.pid, function (err, kids) {
if (psTree.hasPS) {
spawn('kill', ['-s', sig, child.pid].concat(kids.map(p => p.PID)))
spawn('kill', ['-s', sig, child.pid].concat(kids))
.on('close', callback);
} else {
// make sure we kill from smallest to largest
const pids = kids.map(p => p.PID).concat(child.pid).sort();
const pids = kids.concat(child.pid).sort();
pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => { });
});
Expand Down
4 changes: 4 additions & 0 deletions test/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker build -t nodemon-test-env .
docker run --mount type=bind,source=/Users/remy/Sites/nodemon,target=/src/nodemon --name nodemon-test-env --rm -it nodemon-test-env bash

# node /nodemon-src/bin/nodemon.js -V http.js
2 changes: 1 addition & 1 deletion test/fork/run-mac-only.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const filenames = [
[__dirname + 'some\ \\file', '#!/bin/sh\necho "OK"'],
];

if (!process.env.TRAVIS && process.platform === 'darwin') {
if (false && !process.env.TRAVIS && process.platform === 'darwin') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is not intended to stay… 😉

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to remove those tests altogether. They don't run in travis (intentionally) and they're messing with local tests. The tests will pass and fail at random on a mac, so they're not doing their job properly.

describe('nodemon fork (mac only)', () => {
before(() => {
filenames.map(file => fs.writeFileSync(file[0], file[1], 'utf8'));
Expand Down