From 64187e11a10fa711171abb2e7cad0b0a7ca0fab9 Mon Sep 17 00:00:00 2001 From: arne_f Date: Tue, 4 Mar 2008 06:37:05 +0000 Subject: [PATCH] sane configuration git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1247 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/cdrom_corever | 2 +- config/rootfiles/packages/sane | 5 ++++ config/sane/saned.conf | 24 ++++++++++++++++ lfs/sane | 6 +++- src/initscripts/init.d/sane | 50 ++++++++++++++++++++++++++++++++++ src/scripts/sanedloop | 8 ++++++ 6 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 config/sane/saned.conf create mode 100644 src/initscripts/init.d/sane create mode 100644 src/scripts/sanedloop diff --git a/config/rootfiles/cdrom_corever b/config/rootfiles/cdrom_corever index 45a4fb75db..ec635144f6 100644 --- a/config/rootfiles/cdrom_corever +++ b/config/rootfiles/cdrom_corever @@ -1 +1 @@ -8 +9 diff --git a/config/rootfiles/packages/sane b/config/rootfiles/packages/sane index 87eb5faae9..75613aa15a 100644 --- a/config/rootfiles/packages/sane +++ b/config/rootfiles/packages/sane @@ -566,3 +566,8 @@ usr/etc/sane.d/mustek_pp.conf usr/lib/sane/libsane-mustek_pp.so usr/lib/sane/libsane-mustek_pp.so.1 usr/lib/sane/libsane-mustek_pp.so.1.0.19 +etc/rc.d/init.d/sane +etc/rc.d/rc3.d/S95sane +etc/rc.d/rc0.d/K10sane +etc/rc.d/rc6.d/K10sane +usr/local/bin/sanedloop diff --git a/config/sane/saned.conf b/config/sane/saned.conf new file mode 100644 index 0000000000..7e25244ebb --- /dev/null +++ b/config/sane/saned.conf @@ -0,0 +1,24 @@ +# +# saned.conf +# +# The contents of the saned.conf file is a list of host names, IP +# addresses or IP subnets (CIDR notation) that are permitted to use local +# SANE devices. IPv6 addresses must be enclosed in brackets, and should +# always be specified in their compressed form. +# +# The hostname matching is not case-sensitive. +# +#scan-client.somedomain.firm +#192.168.0.1 +#192.168.0.1/29 +#[2001:7a8:185e::42:12] +#[2001:7a8:185e::42:12]/64 +# +# NOTE: /etc/inetd.conf (or /etc/xinetd.conf) and +# /etc/services must also be properly configured to start +# the saned daemon as documented in saned(8), services(4) +# and inetd.conf(4) (or xinetd.conf(5)). +# +# a singe "+" allow all hosts to connect. ++ + diff --git a/lfs/sane b/lfs/sane index caa2824f93..da35cfab90 100644 --- a/lfs/sane +++ b/lfs/sane @@ -34,7 +34,7 @@ TARGET = $(DIR_INFO)/$(THISAPP) PROG = sane PAK_VER = 1 -DEPS = "" +DEPS = "libtiff" ############################################################################### # Top-level Rules @@ -81,5 +81,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) --enable-parport-directio cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install + cp -vf $(DIR_SRC)/config/sane/saned.conf /usr/etc/sane.d/ + ln -sf ../init.d/sane /etc/rc.d/rc3.d/S95sane + ln -sf ../init.d/sane /etc/rc.d/rc0.d/K10sane + ln -sf ../init.d/sane /etc/rc.d/rc6.d/K10sane @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/initscripts/init.d/sane b/src/initscripts/init.d/sane new file mode 100644 index 0000000000..3ada557610 --- /dev/null +++ b/src/initscripts/init.d/sane @@ -0,0 +1,50 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/sane +# +# Description : Sane Network deamon +# +# Authors : Arne Fitzenreiter (arne_f@ipfire.org) +# +# Version : 01.00 +# +# Notes : runs sanedloop ibecause saned is intended +# for use with (x)inet.d +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg "Starting sane - network scanner deamon..." + killall sanedloop > /dev/nul 2&>1 + killall saned > /dev/nul 2&>1 + /usr/local/bin/sanedloop & + evaluate_retval + ;; + + stop) + boot_mesg "Stopping sane - network scanner deamon..." + killall sanedloop > /dev/nul 2&>1 + killall saned > /dev/nul 2&>1 + echo_ok + ;; + + restart) + ${0} start + ;; + + status) + statusproc /usr/bin/sanedloop + statusproc /usr/sbin/saned + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/sane diff --git a/src/scripts/sanedloop b/src/scripts/sanedloop new file mode 100644 index 0000000000..f29425af4b --- /dev/null +++ b/src/scripts/sanedloop @@ -0,0 +1,8 @@ +#!/bin/sh +# +# saned is intended for use with (x)inet.d so we have to recall it in a loop +# +while true; +do + /usr/sbin/saned -s0; +done; -- 2.39.2