unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36838: mcron leaves zombies around
@ 2019-07-29 15:39 Robert Vollmert
  2021-08-24  3:55 ` Maxim Cournoyer
  2021-08-24 10:12 ` Leo Prikler
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Vollmert @ 2019-07-29 15:39 UTC (permalink / raw)
  To: 36838

It seems that mcron doesn’t clean up after itself. I regularly see
some zombie processes around, presumably left over by each of my
two 15-minute cron jobs:

root     21285  0.0  0.3  24124  3248 ?        Ss   11:05   0:00 /gnu/store/mamwayq00mqs85kgs6ibww7xw6dy776s-mcron-1.1.1/bin/mcron /gnu/store/rdi71izz4d16v77hb8h2jks0s3q9zini-mcron-job /gnu/store/k7dn1v7qpi4kz183glmbgsf1c7pj19xx-mcron-job /gnu/store/lfyj23bzhc14y5rqi91g493jql9dphxk-mcron-job /gnu/store/mx9k5n92kmhryn3vh4607hrmnkjb8dl6-mcron-job /gnu/store/l4nxmajr0i5g07fxvrgnaw29zd1jq0qw-mcron-job
root     26611  0.0  0.0      0     0 ?        Z    17:29   0:00 [mcron] <defunct>
root     26612  0.0  0.0      0     0 ?        Z    17:29   0:00 [mcron] <defunct>

In case that matters, they’re defined using the following:

(define puzzledb-tweets-pzv-job
  (let* ((exp
          (with-imported-modules '((helpers))
            #~(begin
                (use-modules (helpers))
                (let ((backend (read-secret "tools.jwt"))
                      (twitter (read-secret "twitter.token")))
                  (runl (string-append #$puzzledb-tools "/bin/tweets")
                        "-backend_token" backend
                        "-token" twitter
                        "-deletes")))))
         (script (program-file "puzzledb-tweets-pzv-job" exp)))
    #~(job "*/15 * * * *" ; every fifteen minutes
           #$script)))

where the module helpers contains:

(define-module (helpers)
  #:use-module (ice-9 textual-ports)
  #:export (runl read-secret))

(define* (runl prog . args)
  (apply execl prog prog args))

(define* (read-secret file)
  (string-trim-both
    (get-string-all
      (open-input-file
        (string-append "/etc/puzzledb/secrets/" file)))))

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

* bug#36838: mcron leaves zombies around
  2019-07-29 15:39 bug#36838: mcron leaves zombies around Robert Vollmert
@ 2021-08-24  3:55 ` Maxim Cournoyer
  2021-08-24 10:12 ` Leo Prikler
  1 sibling, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2021-08-24  3:55 UTC (permalink / raw)
  To: Robert Vollmert; +Cc: 36838

Hello Robert,

Robert Vollmert <rob@vllmrt.net> writes:

> It seems that mcron doesn’t clean up after itself. I regularly see
> some zombie processes around, presumably left over by each of my
> two 15-minute cron jobs:
>
> root     21285  0.0  0.3  24124  3248 ?        Ss   11:05   0:00 /gnu/store/mamwayq00mqs85kgs6ibww7xw6dy776s-mcron-1.1.1/bin/mcron /gnu/store/rdi71izz4d16v77hb8h2jks0s3q9zini-mcron-job /gnu/store/k7dn1v7qpi4kz183glmbgsf1c7pj19xx-mcron-job /gnu/store/lfyj23bzhc14y5rqi91g493jql9dphxk-mcron-job /gnu/store/mx9k5n92kmhryn3vh4607hrmnkjb8dl6-mcron-job /gnu/store/l4nxmajr0i5g07fxvrgnaw29zd1jq0qw-mcron-job
> root     26611  0.0  0.0      0     0 ?        Z    17:29   0:00 [mcron] <defunct>
> root     26612  0.0  0.0      0     0 ?        Z    17:29   0:00 [mcron] <defunct>
>
> In case that matters, they’re defined using the following:
>
> (define puzzledb-tweets-pzv-job
>   (let* ((exp
>           (with-imported-modules '((helpers))
>             #~(begin
>                 (use-modules (helpers))
>                 (let ((backend (read-secret "tools.jwt"))
>                       (twitter (read-secret "twitter.token")))
>                   (runl (string-append #$puzzledb-tools "/bin/tweets")
>                         "-backend_token" backend
>                         "-token" twitter
>                         "-deletes")))))
>          (script (program-file "puzzledb-tweets-pzv-job" exp)))
>     #~(job "*/15 * * * *" ; every fifteen minutes
>            #$script)))
>
> where the module helpers contains:
>
> (define-module (helpers)
>   #:use-module (ice-9 textual-ports)
>   #:export (runl read-secret))
>
> (define* (runl prog . args)
>   (apply execl prog prog args))
>
> (define* (read-secret file)
>   (string-trim-both
>     (get-string-all
>       (open-input-file
>         (string-append "/etc/puzzledb/secrets/" file)))))

Thank you for the report.

I don't seem to have any mcron zombies on my system and have one job
running every 5 minutes, another once per day, another every 3 days.

Does the problem still exist for you?

Thanks,

Maxim




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

* bug#36838: mcron leaves zombies around
  2019-07-29 15:39 bug#36838: mcron leaves zombies around Robert Vollmert
  2021-08-24  3:55 ` Maxim Cournoyer
@ 2021-08-24 10:12 ` Leo Prikler
  2021-08-29 21:35   ` Maxim Cournoyer
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Prikler @ 2021-08-24 10:12 UTC (permalink / raw)
  To: maxim.cournoyer, 36838

Hi Maxim,

I still have a defunct mcron flying around with a fairly standard Guix
configuration.  The only service running through mcron seems to be
rottlog-service-type.

Regards





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

* bug#36838: mcron leaves zombies around
  2021-08-24 10:12 ` Leo Prikler
@ 2021-08-29 21:35   ` Maxim Cournoyer
  2023-07-20 13:19     ` Maxim Cournoyer
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Cournoyer @ 2021-08-29 21:35 UTC (permalink / raw)
  To: 36838; +Cc: Leo Prikler

Hi Leo,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

> Hi Maxim,
>
> I still have a defunct mcron flying around with a fairly standard Guix
> configuration.  The only service running through mcron seems to be
> rottlog-service-type.

If you have the energy/bandwidth, would you mind trying this patch here:
https://lists.gnu.org/archive/html/bug-mcron/2021-08/msg00008.html; it
may have positive side-effects in that regard, I believe.

I've modified the mcron package to use a local checkout in my system
config like so:

--8<---------------cut here---------------start------------->8---
@@ -2,7 +2,14 @@
 ;;; RAID-1c3 storage bay.
 (use-modules (gnu)
              (guix modules)
-             (srfi srfi-1))
+             (srfi srfi-1)
+             ;; for mcron experiment
+             (gnu packages autotools)
+             (gnu packages guile-xyz)
+             (gnu packages man)
+             (gnu packages texinfo)
+             (guix git)
+             (guix packages))
 
 (use-service-modules admin desktop docker linux mail mcron networking nfs nix
                      spice ssh sysctl telephony virtualization vpn xorg)
@@ -196,6 +203,15 @@
         (pam-limits-entry "@realtime" 'both 'memlock 'unlimited)))
       (service mcron-service-type
                (mcron-configuration
+                (mcron (package/inherit mcron
+                         (source (git-checkout
+                                  (url "file:///home/maxim/src/mcron")))
+                         (native-inputs (append
+                                         `(("autoconf" ,autoconf)
+                                           ("automake" ,automake)
+                                           ("help2man" ,help2man)
+                                           ("texinfo" ,texinfo))
+                                         (package-native-inputs mcron)))))
                 (jobs (list duckdns-job
                             backup-home-job
--8<---------------cut here---------------end--------------->8---

The output is now annotated as:

--8<---------------cut here---------------start------------->8---
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: completed in 93.625s
2021-08-25T00:05:00 duckdns-update: running...
2021-08-25T00:05:01 duckdns-update: completed in 0.519s
--8<---------------cut here---------------end--------------->8---

And I don't have any mcron zombie process lying around, unless I'm
reading the ps output wrong.

Thanks,

Maxim




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

* bug#36838: mcron leaves zombies around
  2021-08-29 21:35   ` Maxim Cournoyer
@ 2023-07-20 13:19     ` Maxim Cournoyer
  0 siblings, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2023-07-20 13:19 UTC (permalink / raw)
  To: 36838-done; +Cc: Leo Prikler

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Leo,
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
>> Hi Maxim,
>>
>> I still have a defunct mcron flying around with a fairly standard Guix
>> configuration.  The only service running through mcron seems to be
>> rottlog-service-type.
>
> If you have the energy/bandwidth, would you mind trying this patch here:
> https://lists.gnu.org/archive/html/bug-mcron/2021-08/msg00008.html; it
> may have positive side-effects in that regard, I believe.
>
> I've modified the mcron package to use a local checkout in my system
> config like so:
>
> @@ -2,7 +2,14 @@
>  ;;; RAID-1c3 storage bay.
>  (use-modules (gnu)
>               (guix modules)
> -             (srfi srfi-1))
> +             (srfi srfi-1)
> +             ;; for mcron experiment
> +             (gnu packages autotools)
> +             (gnu packages guile-xyz)
> +             (gnu packages man)
> +             (gnu packages texinfo)
> +             (guix git)
> +             (guix packages))
>  
>  (use-service-modules admin desktop docker linux mail mcron networking nfs nix
>                       spice ssh sysctl telephony virtualization vpn xorg)
> @@ -196,6 +203,15 @@
>          (pam-limits-entry "@realtime" 'both 'memlock 'unlimited)))
>        (service mcron-service-type
>                 (mcron-configuration
> +                (mcron (package/inherit mcron
> +                         (source (git-checkout
> +                                  (url "file:///home/maxim/src/mcron")))
> +                         (native-inputs (append
> +                                         `(("autoconf" ,autoconf)
> +                                           ("automake" ,automake)
> +                                           ("help2man" ,help2man)
> +                                           ("texinfo" ,texinfo))
> +                                         (package-native-inputs mcron)))))
>                  (jobs (list duckdns-job
>                              backup-home-job
>
>
> The output is now annotated as:
>
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: Cannot open mailer: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: mail: cannot send message: No such file or directory
> 2021-08-25T00:01:34 /gnu/store/xcngj8vg5j8g54r3aqm71vbgsgrsjl31-rottlog-0.72.2/sbin/rottlog: completed in 93.625s
> 2021-08-25T00:05:00 duckdns-update: running...
> 2021-08-25T00:05:01 duckdns-update: completed in 0.519s
>
> And I don't have any mcron zombie process lying around, unless I'm
> reading the ps output wrong.

It's been a while and I haven't seen this problem myself in all this
time; closing.  Do reopen if you encounter it or better yet, have a
reproducer for it.

-- 
Thanks,
Maxim




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

end of thread, other threads:[~2023-07-20 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-29 15:39 bug#36838: mcron leaves zombies around Robert Vollmert
2021-08-24  3:55 ` Maxim Cournoyer
2021-08-24 10:12 ` Leo Prikler
2021-08-29 21:35   ` Maxim Cournoyer
2023-07-20 13:19     ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).