1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-31 05:41:08 +00:00
freebsd-ports/graphics/sane-backends/files/saned.in
Doug Barton 018f02b917 Relative to the problem mentioned in the PR, fix the rc.d script
to avoid a circular dependency problem which adversely affects
other scripts, including those in the base.

Specifically, it's impossible to have both:
REQUIRE: LOGIN
and
BEFORE: NETWORKING

Since this services runs as an unprivileged user, LOGIN wins.

While I'm here, apply various other cleanups, including adding
KEYWORD: shutdown, putting the elements in more typical order,
fixing some syntax issues, etc.

Bump PORTREVISION due to the previous incarnation of the rc.d
script being actually pathological, rather than just slightly
wacky.

PR:		ports/165928
Submitted by:	Matt Dawson <matt@chronos.org.uk>
Feature safe:	yes
2012-03-19 23:33:15 +00:00

36 lines
538 B
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: saned
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable saned:
# saned_enable="YES"
. /etc/rc.subr
name=saned
rcvar=saned_enable
load_rc_config saned
: ${saned_enable:="NO"}
: ${saned_uid:="saned"}
command="%%PREFIX%%/sbin/saned"
start_precmd=saned_prestart
saned_prestart()
{
case "${saned_flags}" in
*-a\ *) err 1 'saned_flags includes the -a option. Please use saned_uid instead' ;;
esac
}
command_args="-a $saned_uid"
run_rc_command "$1"