How to suspend / resume a process in Linux

I am recording my program before it closes.

Run command:

cvlc screen:// --screen-left=0 --screen-top=0 --screen-width=1280 --screen-height=960 --screen-fps=30 \
--sout '#transcode{vcodec=mp2v, vb=800, scale=1, acodec=none}:file{mux=ts, dst=your_video_path_to_be_saved}'

      

Stop command:

kill -9 pgrep vlc

      

This works well, now I need to implement a pause method for this program. I need to kill the program using the pause method, then run it on the resume method and add the new video to the older one. How can i do this?

VLC Wiki: Merge

+3


source to share


2 answers


To pause the process

kill -STOP <PID>

      



To resume it

kill -CONT <PID>

      

+9


source


Ctrl+ z(SIGTSTP) from the shell stops (for now we will probably use the term "suspend", which is the bash man page). The process can be continued ("resumed") with the fg (foreground) or bg (background) commands.



kill -9 does not stop the process, it kills it (SIGKILL). I mention this because the wording is ambiguous here.

+3


source







All Articles