Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: Pintu Agarwal <pintu.ping@gmail.com>
To: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
Cc: Kernelnewbies <kernelnewbies@kernelnewbies.org>,
	Shyam Saini <mayhs11saini@gmail.com>,
	pedro@palves.net, open list <linux-kernel@vger.kernel.org>
Subject: Re: Pause a process execution from external program
Date: Mon, 17 Jun 2019 17:50:32 +0530
Message-ID: <CAOuPNLj4useN+BiPJvd2MRMntELt=_Kc_8x=mbxfrkgWh5v7Mw@mail.gmail.com> (raw)
In-Reply-To: <13999.1560455005@turing-police>

On Fri, Jun 14, 2019 at 1:13 AM Valdis Klētnieks
<valdis.kletnieks@vt.edu> wrote:
>
> On Thu, 13 Jun 2019 13:22:12 +0530, Shyam Saini said:
>
> > from command line we use ctrl-z to stop execution of a foreground
> > process but you can program
> > SIGTSTP signal handler in your application code to do the same.
>
> Note that if you simply fail to include a signal handler for SIGSTOP and
> SIGCONT, it will Do The Right Thing.  The only programs that need worry about
> SIGTSTP are ones like 'vi' that may want to do something (like restore the
> terminal state from raw to cooked mode, etc) before they stop.  That's why you
> can control-z /bin/cat without it having to include a signal handler for it.
>
> % kill -STOP `pidof process-to-stop`   # stop it
> % kill -CONT `pidof process-to-stop`  # and make it run again.
>
> No source code modifications needed.  No source needed.
>
> Now, if you want to make it stop at a *specific point*, then you're into
> ptrace territory, and source will be helpful.
>
Yes, I think ptrace can serve our purpose.
Thank you so much.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13  7:43 Pintu Agarwal
2019-06-13  7:52 ` Shyam Saini
2019-06-13 14:53   ` Pintu Agarwal
2019-06-13 19:43   ` Valdis Klētnieks
2019-06-17 12:20     ` Pintu Agarwal [this message]
2019-06-13 15:21 ` Elias Kouskoumvekakis
2019-06-17 12:19   ` Pintu Agarwal

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOuPNLj4useN+BiPJvd2MRMntELt=_Kc_8x=mbxfrkgWh5v7Mw@mail.gmail.com' \
    --to=pintu.ping@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mayhs11saini@gmail.com \
    --cc=pedro@palves.net \
    --cc=valdis.kletnieks@vt.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox