aboutsummaryrefslogtreecommitdiff
path: root/apks/reddit-importer/reddit-importer.initd
blob: 7298269069caf0e3a221d25e0a297a8369d66e33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/sbin/openrc-run
supervisor="supervise-daemon"

name="reddit-importer"
command="/usr/bin/reddit-importer"
command_args="-id ${client_id}
        --secret ${client_secret}
        -username ${reddit_username}
        -password ${reddit_password}
        "
command_background="yes"

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
}