From 0204e511bd3a183291c0582d51ee0f0c177754ec Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 16 Oct 2022 23:04:48 +0000 Subject: ref: Update openrc files Cleaning up the initd and confd files to make easier to setup and run multi service. --- .../reddit-nextcloud-importer.initd | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd') diff --git a/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd b/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd index 7b48eeb..9beed1f 100644 --- a/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd +++ b/apks/reddit-nextcloud-importer/reddit-nextcloud-importer.initd @@ -3,15 +3,28 @@ supervisor="supervise-daemon" name="reddit-nextcloud-importer" command="/usr/bin/reddit-nextcloud-importer" -command_args=" -c ${client_id} -s ${client_secret} -u ${reddit_username} -p ${reddit_password} -P ${nextcloud_password} -U ${nextcloud_username} -o ${nextcloud_host}" +command_args="-c ${client_id} + -s ${client_secret} + -u ${reddit_username} + -p ${reddit_password} + -P ${nextcloud_password} + -U ${nextcloud_username} + -o ${nextcloud_host} + " command_background="yes" -supervise_daemon_args="--user www-data:www-data" +supervise_daemon_args="--user $cmd_user -d $tmp_dir" pidfile="/run/$RC_SVCNAME.pid" output_log="$logfile" error_log="$logfile" +start_pre() { + if [ "$logfile" ]; then + checkpath --file --mode 0640 --owner "cmd_user" "$logfile" || return 1 + fi + checkpath --directory --owner "$cmd_user" --mode 0775 "$tmp_dir" || return 1 +} + depend() { use net } - -- cgit v1.2.3