If you're not into 
systemd https://gist.github.com/tgbugs/c2990382b3fdfef86a2a3a1bc0516099 is 
an example of an openrc init script that I use to daemonize a servlet 
(running behind nginx) which is an echo server that responds with the ip of 
the requester and that is initialized like this:
(serve/servlet main
                 #:port 4000
                 #:servlet-path server-base-path
                 #:server-root-path "/dev/null"
                 #:servlet-regexp #rx""
                 #:servlet-responder responder  ; prevent stack trace from 
leaking
                 #:file-not-found-responder 404-responder
                 #:stateless? #t
                 #:banner? #f
                 #:launch-browser? #f
                 #:command-line? #t)


On Wednesday, November 28, 2018 at 6:56:25 PM UTC-8, Brian Adkins wrote:
>
> I briefly looked at the daemonize package on Ubuntu linux, but couldn't 
> get it to work properly. I found the following Rosetta Code page:
>
> https://rosettacode.org/wiki/Run_as_a_daemon_or_service#Racket
>
> So, I just tried the code in that example, and it seems to work fine:
>
> (module+ main
>         * ((get-ffi-obj 'daemon #f (_fun _int _int -> _int)) 0 0)*
>          (serve/servlet
>           dispatcher
>           #:log-file "hello.log"
>           #:stateless? #t
>           #:port 6995
>           #:command-line? #t
>           #:file-not-found-responder not-found
>           #:launch-browser? #f
>           #:servlet-regexp #rx""))
>
> I'm just wondering if there is a better way to accomplish this since it 
> feels a bit kludgy to me.
>
> Thanks,
> Brian
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to