File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ EGDIR= ${PREFIX}/share/examples/sftpgo
1616USE_LANGUAGES = c
1717USE_TOOLS = tar
1818
19+ DEPENDS+ = daemonize>=1.7.8:../../sysutils/daemonize
20+
1921GO_BUILD_PATTERN =
2022
2123CONF_FILES = ${EGDIR}/sftpgo.json ${PKG_SYSCONFDIR}/sftpgo.json
@@ -43,6 +45,9 @@ SUBST_SED.set-path= -e 's|"openapi"|"${PREFIX}/share/sftpgo/openapi"|g'
4345SUBST_SED.set-path+ = -e 's|"static"|"${PREFIX}/share/sftpgo/static"|g'
4446SUBST_SED.set-path+ = -e 's|"templates"|"${PREFIX}/share/sftpgo/templates"|g'
4547
48+ RCD_SCRIPTS+ = sftpgo
49+ FILES_SUBST+ = SFTPGO_USER=${SFTPGO_USER:Q}
50+
4651.include "go-modules.mk"
4752
4853post-build :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! @RCD_SCRIPTS_SHELL@
2-
2+ #
3+ # $NetBSD$
4+ #
35# PROVIDE: sftpgo
46# REQUIRE: DAEMON
5-
6- if [ -f /etc/rc.subr ]; then
7- . /etc/rc.subr
8- fi
7+ # KEYWORD: shutdown
98
109name=" sftpgo"
11- rcvar=$name
12- command=" @PREFIX@/sbin/bitlbee"
13- pidfile=" @VARBASE@/run/${name} /pid"
14- command_args=" -F" # run as a fork daemon
15- start_precmd=" bitlbee_precmd"
16-
17- bitlbee_precmd ()
18- {
19- if [ ! -d " @VARBASE@/run/${name} " ]; then
20- @MKDIR@ " @VARBASE@/run/${name} "
21- @CHMOD@ 0700 " @VARBASE@/run/${name} "
22- @CHOWN@ @BITLBEE_USER@:@BITLBEE_GROUP@ " @VARBASE@/run/${name} "
23- fi
24- }
25-
26- if [ -f /etc/rc.subr ]; then
27- load_rc_config $name
10+
11+ command=" @PREFIX@/sbin/daemonize"
12+
13+ pidfile=" @VARBASE@/run/${name} .pid"
14+
15+ task=" @PREFIX@/bin/${name} "
16+ task_args=" serve --config-dir @VARBASE@/sftpgo --config-file @PKG_SYSCONFDIR@/sftpgo.json"
17+
18+ procname=" ${task} "
19+
20+ command_args=" -p ${pidfile} \
21+ -u @SFTPGO_USER@ \
22+ -c @VARBASE@/${name} \
23+ -e @VARBASE@/${name} /${name} .stderr \
24+ -o @VARBASE@/${name} /${name} .stdout \
25+ ${task} ${task_args} "
26+
27+ if [ -f @SYSCONFBASE@/rc.subr ]; then
28+ . @SYSCONFBASE@/rc.subr
29+
30+ rcvar=${name}
31+ pidfile=" @VARBASE@/run/${name} .pid"
32+
33+ load_rc_config ${name}
2834 run_rc_command " $1 "
2935else
30- echo -n " ${name} "
31- ${command} ${bitlbee_flags} ${command_args}
36+ @ECHO@ -n " ${name} "
37+
38+ ${command} ${command_args}
3239fi
You can’t perform that action at this time.
0 commit comments