/etc/init.d/capi4hylafax is in capi4hylafax 1:01.03.00.99.svn.300-20+b1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | #! /bin/sh
#
# Start or stop c2faxrecv daemon.
# It is driven by configuration file /etc/default/capi4hylafax.
#
# LSB information
# Hylafax (that is hylafax, faxq, hfaxd) in "Should" and not
# "Required" because capi4hylafax can also be used in stand-alone
# mode; local admins should feel totally free to change this if they
# run capi4hylafax in combination with HylaFax.
# A similar remark applies to capiutils capiinit isdnutils
# isdnactivecards: If your ISDN modem actually needs those, move them
# to Required.
#
### BEGIN INIT INFO
# Provides: capi4hylafax c2faxrecv
# Required-Start: $local_fs $remote_fs $syslog capiutils
# Required-Stop: $local_fs $remote_fs $syslog capiutils
# Should-Start: isdnactivecards
# Should-Stop: isdnactivecards
# X-Start-Before: hylafax
# X-Stop-After: hylafax
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop c2faxrecv daemon
# Description: Manage capi4hylafax daemon for fax reception
### END INIT INFO
test -x /usr/bin/c2faxrecv || exit 0
set -e
# This function clones the /etc directory into the chroot() directory
# Usually hylafax does that for us, but if it isn't running,
# we have to do it ourselves, even if we don't run c2faxrecv (for c2faxsend)
copy_slash_etc()
{
local cfgfile
cfgfile="config.faxCAPI"
local src
src="/etc/hylafax/${cfgfile}"
local dstdir
dstdir="/var/spool/hylafax/etc"
local dst
dst="${dstdir}/${cfgfile}"
if ! [ -d "${dstdir}" ]; then
mkdir -p "${dstdir}" || true
fi
if [ -d "${dstdir}" ]; then
if ! [ "${src}" -ef "${dst}" ]; then
cp -a "${src}" "${dstdir}"
fi
else
echo "Can't create directory ${dstdir}" 1>&2
exit 1
fi
}
copy_slash_etc
run_capi4hylafax=0
if [ -f /etc/default/capi4hylafax ]; then
. /etc/default/capi4hylafax
fi
if [ "${run_capi4hylafax}" = 0 ]; then
cat <<EOF
Please edit the file /etc/hylafax/config.faxCAPI according to your needs.
The current /etc/hylafax/config.faxCAPI is just the sample file that is
provided with the upstream package, so it will not be useful at all for
you. (Please read /usr/share/doc/capi4hylafax/README.Debian)
After you are done you will have to edit /etc/default/capi4hylafax as
well. There you will have to set the variable run_capi4hylafax to 1,
and then type "/etc/init.d/capi4hylafax start" to start the c2faxrecv
daemon.
EOF
exit 0
fi
# Function used to determine if the program is alive
status_code () {
ret=4
if [ -e "${C2FAXRECVPID}" ]; then
if [ -f "${C2FAXRECVPID}" ] && [ -r "${C2FAXRECVPID}" ] ; then
ret=1
pid=`cat "${C2FAXRECVPID}"`
if [ -e /proc/$pid ] ; then
procname=`/bin/ps h -p $pid -C c2faxrecv`
[ -n "$procname" ] && ret=0
fi
fi
else
ret=3
fi
return $ret
}
C2FAXRECVPID=/var/run/c2faxrecv.pid
case "$1" in
start)
echo -n "Starting capi4hylafax: c2faxrecv"
start-stop-daemon --start --quiet --oknodo --background \
--make-pidfile --pidfile $C2FAXRECVPID \
--exec /usr/bin/c2faxrecv
echo "."
;;
stop)
echo -n "Stopping capi4hylafax: c2faxrecv"
start-stop-daemon --stop --quiet --oknodo --pidfile $C2FAXRECVPID
rm -f $C2FAXRECVPID
echo "."
;;
restart | force-reload)
echo -n "Restarting capi4hylafax: c2faxrecv"
start-stop-daemon --stop --quiet --oknodo --pidfile $C2FAXRECVPID
sleep 2
start-stop-daemon --start --quiet --oknodo --background \
--make-pidfile --pidfile $C2FAXRECVPID \
--exec /usr/bin/c2faxrecv
echo "."
;;
status)
echo -n "Status of capi4hylafax c2faxrecv daemon: "
set +e
status_code
sc="${?}"
set -e
case "${sc}" in
0)
echo "alive."
;;
1|3)
echo "dead."
;;
4)
echo "unknown."
;;
esac
exit "${sc}"
;;
*)
echo "Usage: /etc/init.d/capi4hylafax {start|stop|restart|force-reload|status}"
exit 1
esac
exit 0
|