redwood Guru
Joined: 27 Jan 2006 Posts: 306
|
Posted: Tue Jul 29, 2008 5:49 pm Post subject: mgetty+sendfax ttyS0 ownership problems |
|
|
I have an external modem (USRobotics Courier V.Everything) on ttyS0
with mgetty+sendfax listening for dialup connections after hours, and
switching to sendfax mode during work hours.
I want to have the perl script /usr/sbin/faxrunqd running so that I can
send facsimiles with KdePrintFax.
(I don't need to handle incoming faxes
which are handled through an asterisk server
on a separate computer listening on my Digium telephony cards)
mgetty+sendfax's faxrunqd needs /dev/ttyS0 to be owned
by group "fax", so I have a script which sets my modem to faxmode in the morning
by changing mgetty.config and restarting mgetty and starting faxrunqd
as the "fax" user and changing ownership of /dev/ttyS0:
*) touch /etc/nologin.ttyS0 >/dev/null 2>&1; echo "FAX"
cp /etc/mgetty+sendfax/mgetty.config.fax /etc/mgetty+sendfax/mgetty.config;
pkill mgetty #restart in faxmode
pgrep faxrunqd || /usr/sbin/faxrunqd -vd -u fax &
chown uucp.fax /dev/ttyS0
I can now "print to fax" with KDE successfully,
but then the ownership of /dev/ttyS0 gets changed back to uucp.modem which will break
faxrunqd. I've tried adding "fax" to the "modem" group but faxrunqd needs /dev/ttyS0
owned by group "fax"
From /etc/group:
uucp:x:14:uucp,fax
fax:x:5005:<my fax users>
modem:x:5006:<my modem users>, fax
And my udev permissions:
# grep ttyS /etc/udev/permissions.d/50-udev.permissions
ttyS*:root:tty:0660
My /etc/inittab line:
ppp0:12345:respawn:/usr/sbin/mgetty -x 9 ttyS0 -D /dev/ttyS0
My /etc/mgetty+sendfax/mgett.config (in fax mode)
# grep -v '#' /etc/mgetty+sendfax/mgetty.config | grep -v '^$'
debug 4
fax-id 123-456-7890
speed 115200
fax-owner root
fax-group uucp
fax-mode 0640
port ttyS0
debug 3
modem-type fax-only
init-chat "" \d\d\d+++\d\d\dAT&F1 OK ATS0=1 OK AT+FCLASS=2.0 OK
And I have /var/spool/fax/outgoing owned by fax.fax
# ls -l /var/spool/fax/outgoing
total 8
-rw-r--r-- 1 fax fax 44 Jul 29 13:09 faxqueue_done
-rw-r--r-- 1 fax fax 5 Jul 29 13:03 faxrunqd.pid
drwxr-x--- 2 fax fax 96 Jul 25 11:30 locks/
My hunch is that it is faxrunqd itself or sendfax which actually resets ownership of /dev/ttyS0 to uucp.modem
immediately after sending a fax.
Is anybody else using mgetty+sendfax to send faxes?
If so, what ownership/group do you use for your modem and
what user do you run faxrunqd as, and what owner.group do you use
for /var/spool/fax/* ? |
|