pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Radicale3: /etc/rc.d script changes



Module Name:	pkgsrc-wip
Committed By:	snow flurry <snow%datagirl.xyz@localhost>
Pushed By:	flurry
Date:		Sun Nov 8 14:39:44 2020 -0800
Changeset:	c94e5aacb060e54ae09fc2cc19362466a3fe6238

Modified Files:
	Radicale3/files/radicale.sh

Log Message:
Radicale3: /etc/rc.d script changes

- Redirect stderr to logfile
- Use $command/$command_args instead of $start_cmd

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c94e5aacb060e54ae09fc2cc19362466a3fe6238

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Radicale3/files/radicale.sh | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diffs:
diff --git a/Radicale3/files/radicale.sh b/Radicale3/files/radicale.sh
index c2080f48a9..5a7efa23d4 100644
--- a/Radicale3/files/radicale.sh
+++ b/Radicale3/files/radicale.sh
@@ -10,19 +10,29 @@ $_rc_subr_loaded . /etc/rc.subr
 
 name="radicale"
 rcvar=$name
-radicale_user=@RADICALE_USER@
-radicale_group=@RADICALE_GROUP@
+
+load_rc_config $name
+
+: ${radicale_user:=@RADICALE_USER@}
+: ${radicale_group:=@RADICALE_GROUP@}
+: ${radicale_pidfile:="@VARBASE@/run/${name}.pid"}
+: ${radicale_logfile:="@VARBASE@/log/${name}.log"}
+
 command="@PREFIX@/bin/radicale"
-start_cmd="radicale_start"
+command_args=" </dev/null >/dev/null 2>${radicale_logfile} & echo \$! >${radicale_pidfile}"
 command_interpreter="@PYTHONBIN@"
 required_files="@PKG_SYSCONFDIR@/radicale/config"
-pidfile="@VARBASE@/run/${name}.pid"
 
-radicale_start()
+start_precmd="radicale_precmd"
+
+radicale_precmd()
 {
-    nohup ${command} ${command_args} </dev/null >/dev/null 2>&1 &
-    echo $! >${pidfile}
+    @TOUCH@ ${radicale_logfile} && \
+    @CHOWN@ ${radicale_user}:${radicale_group} ${radicale_logfile} && \
+    @CHMOD@ 0750 ${radicale_logfile} && \
+    @TOUCH@ ${radicale_pidfile} && \
+    @CHOWN@ ${radicale_user}:${radicale_group} ${radicale_pidfile} && \
+    @CHMOD@ 0750 ${radicale_pidfile}
 }
 
-load_rc_config $name
 run_rc_command "$1"


Home | Main Index | Thread Index | Old Index