unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Error with mcron-configuration
@ 2018-07-07  0:39 Jone
  2018-07-07  1:40 ` Carlo Zancanaro
  2018-07-07  7:22 ` Pierre Neidhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Jone @ 2018-07-07  0:39 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]

Hello.
guix system --version
guix system (GNU Guix) c3bda394a44ceed39c5ac2f1d07502a3a7502da5

Ver. 1
___________________________________________________________________________
(use-modules
 ...
(gnu services mcron)        ;; ← manual
 ...
(define fstrim-job              ;; ← manual
  #~(job "10 10 * * 6"
         "fstrim -a"))
...
(services (cons*
 ...
  (mcron-service-type (mcron-configuration (jobs (list fstrim-job))))  ;; ←
but here the question
 ...

root@guix ~# guix system -n reconfigure /home/jone/sys.cfg/system-config.scm
guix system: error: failed to load '/home/jone/sys.cfg/system-config.scm':
/home/jone/sys.cfg/system-config.scm:123:25:
/home/jone/sys.cfg/system-config.scm:123:25: Wrong type to apply:
#<service-type mcron 227d4b0>

Ver.2
___________________________________________________________________________
 ...
(mcron-service (mcron-configuration (jobs (list fstrim-job))))  ;; ← manual
 ...

root@guix ~# guix system -n reconfigure /home/jone/sys.cfg/system-config.scm
Backtrace:
In srfi/srfi-1.scm:
   592:29 19 (map1 (#<<service> type: #<service-type mingetty 12c…> …))
   592:29 18 (map1 (#<<service> type: #<service-type mingetty 12c…> …))
   592:29 17 (map1 (#<<service> type: #<service-type mingetty 12c…> …))
   592:29 16 (map1 (#<<service> type: #<service-type mingetty 12c…> …))
   592:29 15 (map1 (#<<service> type: #<service-type mingetty 12c…> …))
   592:29 14 (map1 (#<<service> type: #<service-type agetty 12c19…> …))
   592:29 13 (map1 (#<<service> type: #<service-type console-font…> …))
   592:29 12 (map1 (#<<service> type: #<service-type virtual-term…> …))
   592:29 11 (map1 (#<<service> type: #<service-type ntp 12c1320>…> …))
   592:29 10 (map1 (#<<service> type: #<service-type dbus 12c1460…> …))
   592:29  9 (map1 (#<<service> type: #<service-type elogind 2dfe…> …))
   592:29  8 (map1 (#<<service> type: #<service-type upower 2dfee…> …))
   592:29  7 (map1 (#<<service> type: #<service-type avahi 2dfefa…> …))
   592:29  6 (map1 (#<<service> type: #<service-type wpa-supplica…> …))
   592:29  5 (map1 (#<<service> type: #<service-type network-mana…> …))
   592:29  4 (map1 (#<<service> type: #<service-type slim 2dfef50…> …))
   592:17  3 (map1 (#<<service> type: #<service-type mcron 12c14b0>…>))
In gnu/services.scm:
   777:22  2 (loop #<<service> type: #<service-type mcron 12c14b0> v…>)
In gnu/services/mcron.scm:
    99:33  1 (extend #<<mcron-configuration> mcron: #<package mcron…> …)
In unknown file:
           0 (append #<<mcron-configuration> mcron: #<package mcron…> …)

ERROR: In procedure append:
ERROR: In procedure append: Wrong type argument in position 1 (expecting
empty list): #<<mcron-configuration> mcron: #<package mcron@1.1.1
gnu/packages/guile.scm:683 260f600> jobs: (#<gexp (job "10 10 * * 6"
"fstrim -a") 31b7630>)>

Questions!..

[-- Attachment #2: Type: text/html, Size: 3627 bytes --]

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

* Re: Error with mcron-configuration
  2018-07-07  0:39 Error with mcron-configuration Jone
@ 2018-07-07  1:40 ` Carlo Zancanaro
  2018-07-07  7:22 ` Pierre Neidhardt
  1 sibling, 0 replies; 6+ messages in thread
From: Carlo Zancanaro @ 2018-07-07  1:40 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

Hey Jone!

> ...
>   (mcron-service-type (mcron-configuration (jobs (list 
>   fstrim-job))))
> ...

This is close, but very slightly wrong. `mcron-service-type` isn't 
a procedure, so you can't call it like that. You have to use 
`service`:

  (service mcron-service-type
           (mcron-configuration (jobs (list fstrim-job))))

The manual instead uses the `mcron-service` procedure, which I can 
see you tried below...

> ...
>   (mcron-service (mcron-configuration (jobs (list fstrim-job))))
> ...

... but in this case, you need to not wrap the jobs in 
`mcron-configuration`. So something like this should work:

  (mcron-service (list fstrim-job))

This is outlined in the manual in (guix) Scheduled Job Execution. 
Were you looking elsewhere in the manual for your examples? If 
there's something that pointed you in the wrong direction, please 
let me know where so I can fix it up.

I hope that helps!

Carlo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Error with mcron-configuration
  2018-07-07  0:39 Error with mcron-configuration Jone
  2018-07-07  1:40 ` Carlo Zancanaro
@ 2018-07-07  7:22 ` Pierre Neidhardt
  2018-07-07 22:25   ` Jone
  1 sibling, 1 reply; 6+ messages in thread
From: Pierre Neidhardt @ 2018-07-07  7:22 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]


Jone <yeger9@gmail.com> writes:

> (use-modules
>  ...
> (gnu services mcron)        ;; ← manual
>  ...
> (define fstrim-job              ;; ← manual
>   #~(job "10 10 * * 6"
>          "fstrim -a"))
> ...
> (services (cons*
>  ...
>   (mcron-service-type (mcron-configuration (jobs (list fstrim-job))))  ;; ←
> but here the question
>  ...

Did you use `mcron-service' around `mcron-service-type'?

>  ...
> (mcron-service (mcron-configuration (jobs (list fstrim-job))))  ;; ← manual
>  ...

`mcron-service' takes a list of jobs as argument, not an mcron-configuration.

From the manual:


--8<---------------cut here---------------start------------->8---
 -- Scheme Procedure : mcron-service JOBS [#:mcron MCRON]
     Return an mcron service running MCRON that schedules JOBS, a list
     of gexps denoting mcron job specifications.

     This is a shorthand for:
          (service mcron-service-type
                   (mcron-configuration (mcron mcron) (jobs jobs)))
--8<---------------cut here---------------end--------------->8---

So for you needs you'd need something like:

--8<---------------cut here---------------start------------->8---
(services (cons*
  (mcron-service (list fstrim-job))
  ...)
--8<---------------cut here---------------end--------------->8---

Hope that helps! :)

-- 
Pierre Neidhardt

Sorry, no fortune this time.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Error with mcron-configuration
  2018-07-07  7:22 ` Pierre Neidhardt
@ 2018-07-07 22:25   ` Jone
  2018-07-09 17:40     ` Jone
  0 siblings, 1 reply; 6+ messages in thread
From: Jone @ 2018-07-07 22:25 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

Yes, it was only my mistake, I was in a hurry =) Now «(mcron-service (list
updatedb-job fstrim-job))», reconfigure Ok.


But only it still does not work! At first, ps ax | grep mcron

  292 ?        Ssl    0:00
/gnu/store/9dl8l4krszdd1dhaw94da0nv28ap8dvp-mcron-1.1.1/bin/mcron
/gnu/store/vvf3frpvrffpchbd3xxlq8kmnxsywja6-mcron-job
/gnu/store/jv9asgfm82f6k7srwxy6bf9ckk70z270-mcron-job
/gnu/store/n4jbzmm6ihv70dd8j2ba9501hxs3q9ar-mcron-job
/gnu/store/2yql34psrh6iiyczs48hj7pw5bgv6gh6-mcron-job
7530 ?        Z      0:00 [mcron] <defunct>
11714 ?      Z      0:00 [mcron] <defunct>

Secondly rottlog was never launched («(service rottlog-service-type
(rottlog-configuration))» - right?).
For me, this is not a problem, I just remove mcron from the system
configuration and will start it at user
as «mcron -d». But I think I should have told about this.

[-- Attachment #2: Type: text/html, Size: 972 bytes --]

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

* Re: Error with mcron-configuration
  2018-07-07 22:25   ` Jone
@ 2018-07-09 17:40     ` Jone
  2018-07-09 18:14       ` Clément Lassieur
  0 siblings, 1 reply; 6+ messages in thread
From: Jone @ 2018-07-09 17:40 UTC (permalink / raw)
  Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

*> But only it still does not work!*

With current system version all Ok:

#> sudo herd status mcron
Status of mcron:
  It is started.
  Running value is 298.
  It is enabled.
  Provides (mcron).
  Requires (user-processes).
  Conflicts with ().
  Will be respawned.

ps ax | grep mcron
  298 ?        Ssl    0:00
/gnu/store/9dl8l4krszdd1dhaw94da0nv28ap8dvp-mcron-1.1.1/bin/mcron
/gnu/store/vvf3frpvrffpchbd3xxlq8kmnxsywja6-mcron-job
/gnu/store/jv9asgfm82f6k7srwxy6bf9ckk70z270-mcron-job
/gnu/store/n4jbzmm6ihv70dd8j2ba9501hxs3q9ar-mcron-job
/gnu/store/2yql34psrh6iiyczs48hj7pw5bgv6gh6-mcron-job
  722 pts/0    S+     0:00 grep mcron

[-- Attachment #2: Type: text/html, Size: 749 bytes --]

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

* Re: Error with mcron-configuration
  2018-07-09 17:40     ` Jone
@ 2018-07-09 18:14       ` Clément Lassieur
  0 siblings, 0 replies; 6+ messages in thread
From: Clément Lassieur @ 2018-07-09 18:14 UTC (permalink / raw)
  To: Jone; +Cc: help-guix

Jone <yeger9@gmail.com> writes:

> *> But only it still does not work!*
>
> With current system version all Ok:
>
> #> sudo herd status mcron
> Status of mcron:
>   It is started.
>   Running value is 298.
>   It is enabled.
>   Provides (mcron).
>   Requires (user-processes).
>   Conflicts with ().
>   Will be respawned.
>
> ps ax | grep mcron
>   298 ?        Ssl    0:00
> /gnu/store/9dl8l4krszdd1dhaw94da0nv28ap8dvp-mcron-1.1.1/bin/mcron
> /gnu/store/vvf3frpvrffpchbd3xxlq8kmnxsywja6-mcron-job
> /gnu/store/jv9asgfm82f6k7srwxy6bf9ckk70z270-mcron-job
> /gnu/store/n4jbzmm6ihv70dd8j2ba9501hxs3q9ar-mcron-job
> /gnu/store/2yql34psrh6iiyczs48hj7pw5bgv6gh6-mcron-job
>   722 pts/0    S+     0:00 grep mcron

Hi Jone,

The --schedule option will help you debugging it.

You can do for example:

/gnu/store/9dl8l4krszdd1dhaw94da0nv28ap8dvp-mcron-1.1.1/bin/mcron \
/gnu/store/vvf3frpvrffpchbd3xxlq8kmnxsywja6-mcron-job \
/gnu/store/jv9asgfm82f6k7srwxy6bf9ckk70z270-mcron-job \
/gnu/store/n4jbzmm6ihv70dd8j2ba9501hxs3q9ar-mcron-job \
/gnu/store/2yql34psrh6iiyczs48hj7pw5bgv6gh6-mcron-job --schedule=10

It will compute the times the commands would be run and prints the
information to the screen, and then immediately exits.

See https://www.gnu.org/software/mcron/manual/mcron.html#Invoking-mcron.

Clément

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

end of thread, other threads:[~2018-07-09 18:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-07  0:39 Error with mcron-configuration Jone
2018-07-07  1:40 ` Carlo Zancanaro
2018-07-07  7:22 ` Pierre Neidhardt
2018-07-07 22:25   ` Jone
2018-07-09 17:40     ` Jone
2018-07-09 18:14       ` Clément Lassieur

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