ImonC: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 18: | Zeile 18: | ||
strip * | strip * | ||
cp * /usr/local/bin | cp * /usr/local/bin | ||
</pre> | |||
Telmond liest das syslog bei meiner Konfiguration aus einem eigenem File, welches in ''/etc/syslog.conf'' definiert wird: | |||
<pre> | |||
echo "*.* |/var/log/kernel-info" >> /etc/syslog.conf | |||
kill -1 `cat /var/run/syslogd.pid` | |||
</pre> | </pre> | ||
Zeile 24: | Zeile 30: | ||
'''/etc/init.d/imond''' | '''/etc/init.d/imond''' | ||
<pre> | <pre> | ||
#!/bin/sh | |||
test -f /usr/local/bin/imond || exit 0 | |||
test -f /usr/local/bin/telmond || exit 0 | |||
START_IMOND='yes' # start imond: yes or no | |||
IMOND_PORT='5000' # port (tcp), don't open it to the outside | |||
IMOND_PASS='' # imond-password, may be empty | |||
IMOND_ADMIN_PASS='adminpw' # imond-admin-password, may be empty | |||
IMOND_ENABLE='yes' # accept "enable/disable" commands | |||
IMOND_DIAL='yes' # accept "dial/hangup" commands | |||
IMOND_ROUTE='yes' # accept "route" command | |||
IMOND_REBOOT='no' # accept "reboot" command | |||
DIALMODE='off' # standard dialmode: auto, manual, or off | |||
TELMOND_PORT='5001' # port (tcp), don't open in INPUT_ACCEPT_PORT_x | |||
IMOND_OPT="-port $IMOND_PORT -log-to-syslog /var/log /var/log" | |||
TELMOND_OPT="-port $TELMOND_PORT -log-to-syslog -syslog-fifo /var/log/kernel-info /var/log" | |||
#------------------------------------------------------------------------ | |||
# export some config variables for imond | |||
#------------------------------------------------------------------------ | |||
export START_IMOND IMOND_PASS IMOND_ADMIN_PASS IMOND_ENABLE IMOND_DIAL | |||
export IMOND_ROUTE IMOND_REBOOT DIALMODE | |||
echo $IMOND_PORT >/var/run/imond.port | |||
echo $TELMOND_PORT >/var/run/telmond.port | |||
case "$1" in | |||
start) | |||
echo -n "Starting imond server: telmond" | |||
rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 | |||
start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ | |||
/usr/local/bin/telmond -- $TELMOND_OPT | |||
while [ "`ps aux|grep -v grep|grep -c telmond`" -le 0 ]; do | |||
echo -n "." | |||
start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ | |||
/usr/local/bin/telmond -- $TELMOND_OPT | |||
sleep 1 | |||
done | |||
echo " imond." | |||
start-stop-daemon --start --quiet --pidfile /var/run/imond.pid --exec \ | |||
/usr/local/bin/imond -- $IMOND_OPT | |||
;; | |||
stop) | |||
echo -n "Stopping imond server: telmond imond" | |||
start-stop-daemon --stop --quiet --pidfile /var/run/imond.pid | |||
start-stop-daemon --stop --quiet --pidfile /var/run/telmond.pid | |||
rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 | |||
echo "." | |||
;; | |||
restart|force-reload) | |||
echo -n "Restarting imond server: stop..." | |||
( | |||
start-stop-daemon --stop --quiet --pidfile /var/run/imond.pid | |||
start-stop-daemon --stop --quiet --pidfile /var/run/telmond.pid | |||
rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 | |||
) | |||
while [ "`ps aux|grep -v grep|grep -c telmond`" -gt 0 ]; do | |||
echo -n "." | |||
( killall -9 telmond >/dev/null 2>&1 ) | |||
( killall -9 imond >/dev/null 2>&1 ) | |||
sleep 1 | |||
done | |||
echo -n " start telmond" | |||
start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ | |||
/usr/local/bin/telmond -- $TELMOND_OPT | |||
while [ "`ps aux|grep -v grep|grep -c telmond`" -le 0 ]; do | |||
echo -n "." | |||
start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ | |||
/usr/local/bin/telmond -- $TELMOND_OPT | |||
sleep 1 | |||
done | |||
echo -n " imond" | |||
start-stop-daemon --start --quiet --pidfile /var/run/imond.pid --exec \ | |||
/usr/local/bin/imond -- $IMOND_OPT | |||
echo "." | |||
;; | |||
*) | |||
echo "Usage: /etc/init.d/imond {start|stop|restart|force-reload}" | |||
exit 1 | |||
;; | |||
esac | |||
exit 0 | |||
</pre> | </pre> |
Version vom 22. Januar 2007, 12:28 Uhr
Zur ISDN Anrufsignalisierung verwende ich das Tool ImonC. Dieses benötigt auf dem Server mit der ISDN-Karte die beiden Daemons Imond und Telmond. Die Daemons laufen auf jedem Linux-System mit funktionsfähiger ISDN-Konfiguration, also auch auf Debian mit den capiutils.
Die FLI4L Sourecen laden und entpacken.
mkdir -p /usr/src/fli4l cd /usr/src/fli4l wget http://www.fli4l.de/fileadmin/downloadzaehler.php?file=3.0.2/src.tar.gz tar xvzf src.tar.gz
Im buildroot Verzeichnis kann das Make-System verwendet werden. Alternativ kann man unter src/fli4l/base auch telmond.c und imond.c frei kompilieren.
cd src/buildroot make imond telmond cd target/root/usr/local/bin strip * cp * /usr/local/bin
Telmond liest das syslog bei meiner Konfiguration aus einem eigenem File, welches in /etc/syslog.conf definiert wird:
echo "*.* |/var/log/kernel-info" >> /etc/syslog.conf kill -1 `cat /var/run/syslogd.pid`
Auf Debian verwende ich folgendes Startskript:
/etc/init.d/imond
#!/bin/sh test -f /usr/local/bin/imond || exit 0 test -f /usr/local/bin/telmond || exit 0 START_IMOND='yes' # start imond: yes or no IMOND_PORT='5000' # port (tcp), don't open it to the outside IMOND_PASS='' # imond-password, may be empty IMOND_ADMIN_PASS='adminpw' # imond-admin-password, may be empty IMOND_ENABLE='yes' # accept "enable/disable" commands IMOND_DIAL='yes' # accept "dial/hangup" commands IMOND_ROUTE='yes' # accept "route" command IMOND_REBOOT='no' # accept "reboot" command DIALMODE='off' # standard dialmode: auto, manual, or off TELMOND_PORT='5001' # port (tcp), don't open in INPUT_ACCEPT_PORT_x IMOND_OPT="-port $IMOND_PORT -log-to-syslog /var/log /var/log" TELMOND_OPT="-port $TELMOND_PORT -log-to-syslog -syslog-fifo /var/log/kernel-info /var/log" #------------------------------------------------------------------------ # export some config variables for imond #------------------------------------------------------------------------ export START_IMOND IMOND_PASS IMOND_ADMIN_PASS IMOND_ENABLE IMOND_DIAL export IMOND_ROUTE IMOND_REBOOT DIALMODE echo $IMOND_PORT >/var/run/imond.port echo $TELMOND_PORT >/var/run/telmond.port case "$1" in start) echo -n "Starting imond server: telmond" rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ /usr/local/bin/telmond -- $TELMOND_OPT while [ "`ps aux|grep -v grep|grep -c telmond`" -le 0 ]; do echo -n "." start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ /usr/local/bin/telmond -- $TELMOND_OPT sleep 1 done echo " imond." start-stop-daemon --start --quiet --pidfile /var/run/imond.pid --exec \ /usr/local/bin/imond -- $IMOND_OPT ;; stop) echo -n "Stopping imond server: telmond imond" start-stop-daemon --stop --quiet --pidfile /var/run/imond.pid start-stop-daemon --stop --quiet --pidfile /var/run/telmond.pid rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 echo "." ;; restart|force-reload) echo -n "Restarting imond server: stop..." ( start-stop-daemon --stop --quiet --pidfile /var/run/imond.pid start-stop-daemon --stop --quiet --pidfile /var/run/telmond.pid rm /var/run/imond.pid /var/run/telmond.pid >/dev/null 2>&1 ) while [ "`ps aux|grep -v grep|grep -c telmond`" -gt 0 ]; do echo -n "." ( killall -9 telmond >/dev/null 2>&1 ) ( killall -9 imond >/dev/null 2>&1 ) sleep 1 done echo -n " start telmond" start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ /usr/local/bin/telmond -- $TELMOND_OPT while [ "`ps aux|grep -v grep|grep -c telmond`" -le 0 ]; do echo -n "." start-stop-daemon --start --quiet --pidfile /var/run/telmond.pid --exec \ /usr/local/bin/telmond -- $TELMOND_OPT sleep 1 done echo -n " imond" start-stop-daemon --start --quiet --pidfile /var/run/imond.pid --exec \ /usr/local/bin/imond -- $IMOND_OPT echo "." ;; *) echo "Usage: /etc/init.d/imond {start|stop|restart|force-reload}" exit 1 ;; esac exit 0