linux - running process background

后端 未结 3 1777
陌清茗
陌清茗 2021-01-13 03:05

I want to run a process in a remote linux server and keep that process alive after close the putty terminal,

what is the correct command?

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-13 03:31

    don't use that nohup junk, i hate seeing that on servers; screen is a wasting pile of bits and rot -- use tmux.

    if you want to background a process, double fork like every other daemon since the beginning of time:

    # ((exec sleep 30)&)
    # grep PPid /proc/`pgrep sleep`/status
    PPid:   1
    # jobs
    # disown
    bash: disown: current: no such job
    

    enjoy.

提交回复
热议问题