(signal <sig> 'handler) doesn't work?
Posted: Fri Mar 23, 2007 6:00 pm
newLISP v.9.1.0 on FreeBSD
here's the code that doesn't work:
(define (sig-handler sig)
(println %scriptname ": signal " sig)
(cond
((member sig '(1 30 31))
(save-iplist))
(true
(map (fn (_fd) (net-close (first _fd))) fds)
(save-iplist)
(exit sig))))
;; disables builtin handlers (ctrl-c?)
(command-line nil)
(dolist (s '(1 2 3 15 30 31) (signal s 'sig-handler)))
(save-iplist) would save some data in a file, this works. the program
runs "supervised", see http://smarden.org/runit/. where the program
worked when using CTRL-C on the command line, it doesn't now. i have
many daemons supervised, they all get their signals and invoke their
handlers, but newlisp doesn't. the (println ...) text doesn't show up,
either.
what's wrong with my code? --clemens
here's the code that doesn't work:
(define (sig-handler sig)
(println %scriptname ": signal " sig)
(cond
((member sig '(1 30 31))
(save-iplist))
(true
(map (fn (_fd) (net-close (first _fd))) fds)
(save-iplist)
(exit sig))))
;; disables builtin handlers (ctrl-c?)
(command-line nil)
(dolist (s '(1 2 3 15 30 31) (signal s 'sig-handler)))
(save-iplist) would save some data in a file, this works. the program
runs "supervised", see http://smarden.org/runit/. where the program
worked when using CTRL-C on the command line, it doesn't now. i have
many daemons supervised, they all get their signals and invoke their
handlers, but newlisp doesn't. the (println ...) text doesn't show up,
either.
what's wrong with my code? --clemens