Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mgetty+sendfax ttyS0 ownership problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
redwood
Guru
Guru


Joined: 27 Jan 2006
Posts: 306

PostPosted: Tue Jul 29, 2008 5:49 pm    Post subject: mgetty+sendfax ttyS0 ownership problems Reply with quote

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/* ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum