Giacomo Leidi 4 years ago
parent
commit
0e4bca51ac
2 changed files with 18 additions and 4 deletions
  1. 2 2
      mastostart-gnu/services/mastostart.scm
  2. 16 2
      mastostart-gnu/system/mastostart.scm

+ 2 - 2
mastostart-gnu/services/mastostart.scm

@@ -92,8 +92,8 @@
    (extensions
     (list (service-extension account-service-type
                              (const %mastostart-accounts))
-          (service-extension activation-service-type
-                             %mastostart-activation)
+          ;; (service-extension activation-service-type
+          ;;                    %mastostart-activation)
           (service-extension shepherd-root-service-type
                              mastostart-shepherd-service)))
    (default-value (mastostart-configuration))))

+ 16 - 2
mastostart-gnu/system/mastostart.scm

@@ -1,17 +1,27 @@
 (define-module (mastostart-gnu system mastostart)
   #:use-module (gnu)
+  #:use-module (guix)
   #:use-module (guix packages)
   #:use-module (gnu packages databases)
   #:use-module (guix packages)
   #:use-module (guix build syscalls)
   #:use-module (mastostart-gnu services mastostart))
 
-(use-service-modules databases
+(use-service-modules base
+                     databases
+                     mcron
                      networking
                      shepherd
                      ssh
                      web)
 
+(define-public crawl-job
+  ;; Lancia 'crawl.sh' alle 3AM ogni giorno.  Qui scriviamo
+  ;; il job sotto forma di procedura Scheme.
+  #~(job '(next-hour '(3))
+         (lambda ()
+           (execl (string-append #$mastostart "/web/mustard/crawler/crawl.sh")))))
+
 (define-public %apache-listen-ports '("80"))
 
 (define-public %apache-server-name "127.0.0.1")
@@ -20,7 +30,7 @@
 
 (define-public %apache-conf
   (string-append "
-<Directory / >
+<Directory \"/" %apache-webroot "\" >
     Options FollowSymLinks
     AllowOverride All
 </Directory>
@@ -48,6 +58,10 @@
 
          (mysql-service)
 
+         (service mcron-service-type
+                  (mcron-configuration
+                   (jobs (list crawl-job))))
+
          (service mastostart-service-type
                   (mastostart-configuration
                    (webroot %apache-webroot)))