diff options
Diffstat (limited to 'apks/reddit-importer/reddit-importer.initd')
-rw-r--r-- | apks/reddit-importer/reddit-importer.initd | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apks/reddit-importer/reddit-importer.initd b/apks/reddit-importer/reddit-importer.initd new file mode 100644 index 0000000..7298269 --- /dev/null +++ b/apks/reddit-importer/reddit-importer.initd @@ -0,0 +1,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 +} |