Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline kill process at port

Nicolas Frega
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2018

I have this simple pipelines script:

 image: node:6.9.4

pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install -g truffle
- npm install -g ganache-cli
- npm install
- npm run lint
- npm run solium
- npm run ganache
- sleep 5
- truffle migrate
- truffle test
- su kill `su lsof -t -i:9545`
- npm run coverage

 Can't get the su kill command to pass:

+ su kill `su lsof -t -i:9545`

su: invalid option -- 't'

Usage: su [options] [LOGIN]

Options: -c, --command COMMAND pass COMMAND to the invoked shell

-h, --help display this help message and exit

-, -l, --login make the shell a login shell

-m, -p, --preserve-environment do not reset environment variables, and keep the same shell

-s, --shell SHELL use SHELL instead of the default in passwd

No passwd entry for user 'kill'

Any ideas? 

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2018

Can you try the following?

- apt-get install -y lsof
- kill `lsof -t -i:9545`

Out of curiosity, why do you need to the close the port here? (Rather than letting the build teardown handle it.)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events