#!/bin/sh -e

# The cereal scripts were written by
# Jameson Graef Rollins <jrollins@finestructure.net>
# and
# Daniel Kahn Gillmor <dkg@fifthhorseman.net>.
#
# They are Copyright 2007, and are all released under the GPL, version 3
# or later.

exec 2>&1

SHAREDIR="/usr/share/cereal"
export SHAREDIR
. "$SHAREDIR/common"

LOGUSER="$(cat ../env/LOGUSER)"
LOGGROUP="$(cat ../env/LOGGROUP)"

check_user "$LOGUSER"
check_group "$LOGGROUP"
    
exec chpst -u "$LOGUSER:$LOGGROUP" svlogd -tt ./main <../socket
