From 3f0c451eb4f3571133c2c0f3a208de79b632de97 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Wed, 1 Mar 2023 18:46:28 +0100 Subject: habit tracker service daemon --- config/shepherd/init.d/my-daemons.scm | 15 +++++++++++++++ config/shepherd/init.scm | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 config/shepherd/init.d/my-daemons.scm diff --git a/config/shepherd/init.d/my-daemons.scm b/config/shepherd/init.d/my-daemons.scm new file mode 100644 index 0000000..85de6d2 --- /dev/null +++ b/config/shepherd/init.d/my-daemons.scm @@ -0,0 +1,15 @@ + +(register-services + (make + #:docstring "Habit tracker" + #:provides '(habit-logs) + #:start (make-forkexec-constructor + (list "sbcl" "--load" + (string-append (getenv "HOME") "/.sbclrc") + "--load" + (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/habit.lisp") + "--eval" "(habit-log::main)" "--non-interactive") + #:directory (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/") + #:log-file "/tmp/habits.log") + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:respawn? #t)) diff --git a/config/shepherd/init.scm b/config/shepherd/init.scm index 7b548e9..d7f31b1 100644 --- a/config/shepherd/init.scm +++ b/config/shepherd/init.scm @@ -22,4 +22,4 @@ ;; Services to start when shepherd starts: ;; Add the name of each service that should be started to the list ;; below passed to 'for-each'. -(for-each start '()) +(for-each start '(habit-logs)) -- cgit v1.2.3