unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* How to capture pid of (system process?
@ 2021-12-13 21:01 Jacob Hrbek
  2021-12-14 13:05 ` Tim Van den Langenbergh
  2021-12-14 13:25 ` Maxime Devos
  0 siblings, 2 replies; 6+ messages in thread
From: Jacob Hrbek @ 2021-12-13 21:01 UTC (permalink / raw)
  To: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 820 bytes --]

I wrote this potato-make <https://github.com/spk121/potato-make> 
definition (was simplified):

#:SRC_BEGIN sheme-mode
#!/usr/bin/env sh
exec guile -s "$0" "$@"
!#

(use-modules (ice-9 futures)
  (potato make))
(initialize)

(: "watch" '()
    (~ (do ((i 1 (1+ i)))
       ((> i 6))
     (future (system
      "emacs"))
     ;;(let ((emacs_pid (getpid)))
      ;; (kill emacs_pid SIGTERM)))))

(execute)
#:SRC_END

expecting to capture emacs's pid and kill it, but the issue is that 
using `getpid` gets me the PID of potato-make and `getppid` of the shell 
-> How can i capture just the emacs's pid?

FWIW the projected end-goal is 3600 loop that checks if the 
`my-theme.el` file has been changed to re-launch emacs with the theme 
loaded used for theme development.


[-- Attachment #1.2: publickey - kreyren@rixotstudio.cz - 1677db82.asc --]
[-- Type: application/pgp-keys, Size: 713 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-17 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 21:01 How to capture pid of (system process? Jacob Hrbek
2021-12-14 13:05 ` Tim Van den Langenbergh
2021-12-14 13:25 ` Maxime Devos
2021-12-17  1:32   ` Jacob Hrbek
2021-12-17  6:45     ` Maxime Devos
2021-12-17 16:24     ` Timothy Sample

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).