Skip to content

Instantly share code, notes, and snippets.

@NewGraphEnvironment
Last active February 9, 2023 17:10
Show Gist options
  • Save NewGraphEnvironment/4cfb3647d74b84f9d009b3a38f2b443d to your computer and use it in GitHub Desktop.
Save NewGraphEnvironment/4cfb3647d74b84f9d009b3a38f2b443d to your computer and use it in GitHub Desktop.
find and kill pg_featureserv and pg_tileserv running from `hohup`
#from https://stackoverflow.com/questions/17385794/how-to-get-the-process-id-to-kill-a-nohup-process#:~:text=When%20using%20nohup%20and%20you,you%20need%20to%20force%20kill).
# pg_tileserv
nohup ~/config/pg_tileserv >> pg_tileserv.log 2>&1 &
echo $! > pid_pg_tileserv.txt
#check output with
tail pg_tileserv.log
#identify the pid
pidof pg_tileserv
#or do it auto with a
kill -9 `cat pid_pg_tileserv.txt`
rm pid_pg_tileserv.txt
# --------------------
pg_featureserv
# --------------------
cd ~/config && nohup ./pg_featureserv >> pg_featureserv.log 2>&1 &
echo $! > ~/config/pid_pg_featureserv.txt
#check output with
tail pg_featureserv.log
#identify the pid
pidof pg_featureserv
kill -9 <pid>
#or do it auto with a
kill -9 `cat pid_pg_featureserv.txt`
rm pid_pg_featureserv.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment