LoginSignup
3
3

More than 5 years have passed since last update.

sshでmac miniにログインして複数プロセスを起動

Last updated at Posted at 2016-04-29

背景

リモートのmacサーバにsshでログインして、バックグラウンドで動かし続ける、
っていうのを、数ヶ月に1度くらいの頻度でやるのですが、
shell力が低くていつもやり方を忘れるので方法をまとめました。

ssh でログイン

cd ~/.ssh
ssh -i ./server-id_rsa admin@xxx.xxx.xxx.xxx -p yyyyy

xxx = アドレス
yyyy = ポート番号

参考
http://webkaru.net/linux/ssh-command/

バックグラウンドで起動

nohup redis-server < /dev/null 2>&1 /dev/null &
nohup ./run.sh &

参考
http://qiita.com/tsuyoshi_cho/items/bb385304481ea8fd3ce1

間違って起動したredis-serverを終了

redis-cli
shutdown

参考
http://qiita.com/yoh-nak/items/69c26e7d627e2b5a95e2

間違って起動したshellを終了

ps
kill -SIGINT xxxxx
または
kill -SIGTERM xxxxx

xxxxx = プロセスID

参考
http://equj65.net/tech/linuxprocessgroup/

まとめ

shell力が高いとPCのとこまでに行かなくてすむ

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3