Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Feb 2021 07:57:57 +0100
From:      Jacques Foucry <jacques+freebsd@foucry.net>
To:        freebsd-questions@freebsd.org
Subject:   Startup script
Message-ID:  <YDCy9cqNG%2Bk3IlJk@mithril.foucry.net>

next in thread | raw e-mail | index | archive | help
Hello Folks,

I try to put my self in orbite with gemini. :-)

I choose gemserv as a server (https://sr.ht/~int80h/gemserv/).

Unfortunattly, there is no Startup scriptm for FreeBSD. SO, I tried to create
it. It almost wrong except.. It does not go damonize (which is pretty
annoyoing).

Here is my script (/usr/local/etc/rc.d/gemserv)

#!/bin/sh

# $FreeBSD: 2021-02-20 jfoucry $
# PROVIDE: gemserv
# REQUIRE: networking DAEMON
# KEYWORD: shutdown


. /etc/rc.subr

desc="geminin gemserv server laucnh script"
name=gemserv
rcvar=gemserv_enable

load_rc_config $name

: ${gemserv_user:-gemini}
: ${gemserv_config:=/usr/local/etc/gemini/config.toml}
: ${gemserv_log:=/tmp/gemserv.log}

pidfile=/var/run/gemserv.pid
command=/usr/local/bin/gemserv/target/release/gemserv
command_args="${gemserv_config}"

run_rc_command "$1"

If some body more aware with those kind of ћcript could give me some advises
they will be really appreicate.

Thanks in advance
-- 
Jacques Foucry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YDCy9cqNG%2Bk3IlJk>