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