Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I use Upstart to start iaxmodem and faxgetty when I have multiple modems? Centos 6.4 has a nice warning as listed below which incites me to believe the standard inittab lines will not work.

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

where I would normally put

IAX:2345:respawn:/path/to/iaxmodem ttyIAX
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use a task which is started on change of runlevel to start a job for each IAXModem you want to start. Then use a task to start a faxgetty for each started iaxmodem job.

IE:

init 3 -> start-iaxmodem ---> iaxmodem(ttyIAX0) -> start-faxgetty(ttyIAX0) -> faxgetty(ttyIAX0)
                          \-> iaxmodem(ttyIAX1) -> start-faxgetty(ttyIAX1) -> faxgetty(ttyIAX1)

/etc/init/start-iaxmodems.conf:

# This service starts the configured number of gettys.
start on stopped rc RUNLEVEL=[2345]

task

script
    for ttyIAX in /etc/iaxmodem/* ; do
        start iaxmodem TTY=`basename $ttyIAX`
    done
end script

/etc/init/iaxmodem.conf:

# This service maintains an iaxmodem on the sepcified device.
stop on runlevel [016]

respawn
instance $TTY
exec /usr/sbin/iaxmodem $TTY

/etc/init/start-faxgettys.conf:

# This service starts the configured number of faxgettys.
start on started iaxmodem
# this will run once per triggering iaxmodem instance
instance $INSTANCE

task

script
    # give it time to at least create the device
    /bin/sleep 1s
    start faxgetty TTY=$INSTANCE
end script

/etc/init/faxgetty.conf:

# This service maintains a faxgetty on the sepcified device.
# only stop when the stopping iaxmodem is this TTY
stop on stopping iaxmodem INSTANCE=$TTY

respawn
instance $TTY

exec /usr/sbin/faxgetty $TTY
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.