Hi.

From what I see you miss the following options to pppd (unless they
are present in config file):

nodefaultroute
nodetach

"nodetach" is important here since it stops grps-on process from
quitting (pppd daemonizes) before it has a chance to set-up the
connection. Other way would be to provide a shell script for
gprs-on. A very simple example would be something like:

#!/bin/sh
pppd call your_mmsc
while [ ! -r /var/run/ppp0-mbuni.pid ]; do
 sleep 5
done
exit 0

When everything is correctly configured mbuni stops on SIGTERM and
SIGINT, so CTRL+C should work here. However you may need to check
your privilege set-up: pppd needs to be run with root privileges, so
it should be setuid root or run via sudo; mbuni tries to stop pppd by
sending SIGTERM with kill() call, and that means that in your
configuration mbuni should be run with root privileges too.


Hope that helps,

Piotr

On Thu, Aug 05, 2010 at 08:53:30AM +1100, Emmanuel CHANSON wrote:
> *Hello Piotr,
> 
> Still Mbuni does not want to wait after GPRS connection even with ip-up
> script, do I miss something?
> 
> Following your advises I have configured:
> 
> in /etc/ppp/ip-up symlink to ip-up.sh:*
> *#!/bin/sh
> 
> IFNAME="$1"
> LOCAL_IP="$4"
> REMOTE_IP="$5"
> IPPARAM="$6"
> MMS_PROXY="192.168.39.201"
> 
> ip route add to $MMS_PROXY dev $IFNAME
> # routing has been set up, so:
> ln -sf /var/run/ppp-0.pid /var/run/ppp0-mbuni.pid
> *
> 
> 
> *Then in mmsbox.conf:*
> *custom-settings = "gprs-on=pppd call mobile-auth;gprs-pid=cat
> /var/run/ppp0-mbuni.pid|head -1;port=3130;mmsc-url=
> http://mms.xxxxxx.xx/mmsc;proxy=192.168.39.201:3130;msisdn=100"*
> 
> *Intial ip routing:*
> ----------------------
> # ifconfig;netstat -rn
> 
> eth1      Link encap:Ethernet  HWaddr 00:16:E6:4E:0C:2B
>           inet adr:192.168.0.2  Bcast:192.168.0.255  Masque:255.255.255.0
>           adr inet6: fe80::216:e6ff:fe4e:c2b/64 Scope:Lien
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:1707 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1589 errors:0 dropped:0 overruns:0 carrier:0
> 
>           collisions:0 lg file transmission:1000
>           RX bytes:1445194 (1.3 MiB)  TX bytes:542026 (529.3 KiB)
>           Interruption:20 Adresse de base:0x8000
> 
> lo        Link encap:Boucle locale
>           inet adr:127.0.0.1  Masque:255.0.0.0
>           adr inet6: ::1/128 Scope:Hôte
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:210 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
> 
>           collisions:0 lg file transmission:0
>            RX bytes:17962 (17.5 KiB)  TX bytes:17962 (17.5 KiB)
> 
> 
> Table de routage IP du noyau
> Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt
> Iface
>  192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0
> eth1
> 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0
> eth1
> 0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0
> eth1
> #
> 
> *Then the test:*
> # lynx -dump "
> http://localhost:10003/?username=tester&password=foobar&mmsc=modem&to=%2BXXXXXXXX/TYPE=PLMN&subject=Test-mediacom&text=TEST-MMS-depuis-MBUNI-2
> "
> 
> *but mbuni still complain about:* (no pid file found if I translate)
> *cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
> 2010-08-05 08:36:11 [2580] [5] INFO: mmsbox_mm1.c:659 <start_gprs>
> [mmsbox-mm1] [n/a] waiting for connection: 0, pid=2607 cpid=2607,
> ifexited=1, exitstatus=0
> 2010-08-05 08:36:11 [2580] [5] WARNING: mmsbox_mm1.c:375 <handle_mm1>
> [mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...*
> 
> 
> /var/log/mbuni/*log:
> ----------------------------
> 2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Creating HTTPClient for
> `127.0.0.1'.
> 2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Created HTTPClient area
> 0xb57005b0.
> 2010-08-05 08:23:53 [2403] [14] DEBUG: WSP: Mapping `text/plain', WSP 1.2 to
> 0x0003.
> 2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1366 <make_and_queue_msg>
> [mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user], [transid
> [Mbuni-msg.7033.x1.3.40]: qf7033.1.x403.79
> 2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient area
> 0xb57005b0.
> 2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient for
> `127.0.0.1'.
> 2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1613 <dispatch_sendmms_recv>
> [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
> Mbuni-msg.7033.x1.3.40]
> 
> 2010-08-05 08:23:57 [2403] [7] DEBUG: Queued to thread 0 for
> /var/spool/mbuni/mmsbox_
> outgoing/qf7033.1.x403.79, sendt=1280957033, tnow=1280957037
> 
> arg 0: pppd
> arg 1: call
> arg 2: mobile-auth
> 
> cat: /var/run/ppp0.pid: Aucun fichier ou dossier de ce type
> - Afficher le texte des messages précédents -
> 2010-08-05 08:24:02 [2403] [5] INFO: mmsbox_mm1.c:659 <start_gprs>
> [mmsbox-mm1] [n/a] waiting for connection: 0, pid=2427 cpid=2427,
> ifexited=1, exitstatus=0
> 2010-08-05 08:24:02 [2403] [5] WARNING: mmsbox_mm1.c:375 <handle_mm1>
> [mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...
> 
> /var/log/message:
> --------------------------
> Aug  5 08:23:57 navette kernel: PPP generic driver version 2.4.2
> Aug  5 08:23:57 navette pppd[2430]: pppd 2.4.5 started by admin, uid 0
> Aug  5 08:23:58 navette chat[2431]: abort on (BUSY)
> Aug  5 08:23:58 navette chat[2431]: abort on (NO CARRIER)
> Aug  5 08:23:58 navette chat[2431]: abort on (VOICE)
> Aug  5 08:23:58 navette chat[2431]: abort on (NO DIALTONE)
> Aug  5 08:23:58 navette chat[2431]: abort on (NO DIAL TONE)
> Aug  5 08:23:58 navette chat[2431]: abort on (NO ANSWER)
> Aug  5 08:23:58 navette chat[2431]: abort on (DELAYED)
> Aug  5 08:23:58 navette chat[2431]: report (CONNECT)
> Aug  5 08:23:58 navette chat[2431]: timeout set to 6 seconds
> Aug  5 08:23:58 navette chat[2431]: send (ATQ0^M)
> Aug  5 08:23:58 navette chat[2431]: expect (OK)
> Aug  5 08:23:58 navette chat[2431]: ^M
> Aug  5 08:23:58 navette chat[2431]: NO CARRIER
> Aug  5 08:23:58 navette chat[2431]:  -- failed
> Aug  5 08:23:58 navette chat[2431]: Failed (NO CARRIER)
> Aug  5 08:23:58 navette pppd[2430]: Connect script failed
> Aug  5 08:24:07 navette kernel: tty_port_close_start: tty->count = 1 port
> count = 0.
> 
> 
> Aug  5 08:24:10 navette chat[2435]: abort on (BUSY)
> Aug  5 08:24:10 navette chat[2435]: abort on (NO CARRIER)
> Aug  5 08:24:10 navette chat[2435]: abort on (VOICE)
> Aug  5 08:24:10 navette chat[2435]: abort on (NO DIALTONE)
> Aug  5 08:24:10 navette chat[2435]: abort on (NO DIAL TONE)
> Aug  5 08:24:10 navette chat[2435]: abort on (NO ANSWER)
> Aug  5 08:24:10 navette chat[2435]: abort on (DELAYED)
> Aug  5 08:24:10 navette chat[2435]: report (CONNECT)
> Aug  5 08:24:10 navette chat[2435]: timeout set to 6 seconds
> Aug  5 08:24:10 navette chat[2435]: send (ATQ0^M)
> Aug  5 08:24:10 navette chat[2435]: expect (OK)
> Aug  5 08:24:10 navette chat[2435]: ATQ0^M^M
> Aug  5 08:24:10 navette chat[2435]: OK
> Aug  5 08:24:10 navette chat[2435]:  -- got it
> Aug  5 08:24:10 navette chat[2435]: send (ATZ^M)
> Aug  5 08:24:10 navette chat[2435]: timeout set to 3 seconds
> Aug  5 08:24:10 navette chat[2435]: expect (OK)
> Aug  5 08:24:10 navette chat[2435]: ^M
> Aug  5 08:24:10 navette chat[2435]: ATZ^M^M
> Aug  5 08:24:10 navette chat[2435]: OK
> Aug  5 08:24:10 navette chat[2435]:  -- got it
> Aug  5 08:24:10 navette chat[2435]: send (AT^M)
> Aug  5 08:24:10 navette chat[2435]: expect (OK)
> Aug  5 08:24:10 navette chat[2435]: ^M
> Aug  5 08:24:13 navette chat[2435]: alarm
> Aug  5 08:24:13 navette chat[2435]: send (AT^M)
> Aug  5 08:24:13 navette chat[2435]: expect (OK)
> Aug  5 08:24:13 navette chat[2435]: AT^M^M
> Aug  5 08:24:13 navette chat[2435]: OK
> Aug  5 08:24:13 navette chat[2435]:  -- got it
> Aug  5 08:24:13 navette chat[2435]: send (ATI^M)
> Aug  5 08:24:13 navette chat[2435]: expect (OK)
> Aug  5 08:24:13 navette chat[2435]: ^M
> Aug  5 08:24:13 navette chat[2435]: ATI^M^M
> Aug  5 08:24:13 navette chat[2435]: my300X GPRS^M
> Aug  5 08:24:13 navette chat[2435]: ^M
> Aug  5 08:24:13 navette chat[2435]: OK
> Aug  5 08:24:13 navette chat[2435]:  -- got it
> Aug  5 08:24:13 navette chat[2435]: send (ATZ^M)
> Aug  5 08:24:13 navette chat[2435]: expect (OK)
> Aug  5 08:24:13 navette chat[2435]: ^M
> Aug  5 08:24:13 navette chat[2435]: ATZ^M^M
> Aug  5 08:24:13 navette chat[2435]: OK
> Aug  5 08:24:13 navette chat[2435]:  -- got it
> Aug  5 08:24:13 navette chat[2435]: send (AT^M)
> Aug  5 08:24:13 navette chat[2435]: expect (OK)
> Aug  5 08:24:13 navette chat[2435]: ^M
> Aug  5 08:24:16 navette chat[2435]: alarm
> Aug  5 08:24:16 navette chat[2435]: send (AT^M)
> Aug  5 08:24:16 navette chat[2435]: expect (OK)
> Aug  5 08:24:16 navette chat[2435]: AT^M^M
> Aug  5 08:24:16 navette chat[2435]: OK
> Aug  5 08:24:16 navette chat[2435]:  -- got it
> Aug  5 08:24:16 navette chat[2435]: send (AT+CGDCONT=1,"IP","mms"^M)
> Aug  5 08:24:17 navette chat[2435]: expect (OK)
> Aug  5 08:24:17 navette chat[2435]: ^M
> Aug  5 08:24:17 navette chat[2435]: AT+CGDCONT=1,"IP","mms"^M^M
> Aug  5 08:24:17 navette chat[2435]: OK
> Aug  5 08:24:17 navette chat[2435]:  -- got it
> Aug  5 08:24:17 navette chat[2435]: send (ATDT*99***1#^M)
> Aug  5 08:24:17 navette chat[2435]: timeout set to 30 seconds
> Aug  5 08:24:17 navette chat[2435]: expect (CONNECT)
> Aug  5 08:24:17 navette chat[2435]: ^M
> Aug  5 08:24:17 navette kernel: tty_port_close_start: tty->count = 1 port
> count = 0.
> Aug  5 08:24:18 navette chat[2435]: ATDT*99***1#^M^M
> Aug  5 08:24:18 navette chat[2435]: CONNECT
> Aug  5 08:24:18 navette chat[2435]:  -- got it
> Aug  5 08:24:18 navette chat[2435]: send (^M)
> Aug  5 08:24:18 navette pppd[2430]: Serial connection established.
> Aug  5 08:24:18 navette pppd[2430]: Using interface ppp0
> Aug  5 08:24:18 navette pppd[2430]: Connect: ppp0 <--> /dev/ttyACM1
> Aug  5 08:24:18 navette pppd[2430]: PAP authentication succeeded
> Aug  5 08:24:18 navette kernel: PPP Deflate Compression module registered
> Aug  5 08:24:19 navette pppd[2430]: not replacing existing default route via
> 192.168.0.1
> Aug  5 08:24:19 navette pppd[2430]: local  IP address 10.152.149.196
> Aug  5 08:24:19 navette pppd[2430]: remote IP address 192.168.254.254
> 
> *netstat: ip-up seems to have been launched*
> -----------
> # ll /var/run/ppp*
> lrwxrwxrwx  1 root root   17  5 août  08:31 /var/run/ppp0-mbuni.pid ->
> /var/run/ppp0.pid
> -rw-r--r--  1 root root    5  5 août  08:31 /var/run/ppp0.pid
> 
> # ifconfig; netstat -rn
> 
> eth1      Link encap:Ethernet  HWaddr 00:16:E6:4E:0C:2B
>           inet adr:192.168.0.2  Bcast:192.168.0.255  Masque:255.255.255.0
>           adr inet6: fe80::216:e6ff:fe4e:c2b/64 Scope:Lien
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:1866 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1744 errors:0 dropped:0 overruns:0 carrier:0
> 
>           collisions:0 lg file transmission:1000
>           RX bytes:1348974 (1.2 MiB)  TX bytes:1027418 (1003.3 KiB)
>           Interruption:20 Adresse de base:0x8000
> 
> lo        Link encap:Boucle locale
>           inet adr:127.0.0.1  Masque:255.0.0.0
>           adr inet6: ::1/128 Scope:Hôte
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:231 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:231 errors:0 dropped:0 overruns:0 carrier:0
> 
>           collisions:0 lg file transmission:0
>            RX bytes:17076 (16.6 KiB)  TX bytes:17076 (16.6 KiB)
> 
> *
> ppp0      Link encap:Protocole Point-à-Point
>           inet adr:10.152.59.133  P-t-P:192.168.254.254
> Masque:255.255.255.255
> 
>           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
>           RX packets:4 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 lg file transmission:3
>           RX bytes:58 (58.0 b)  TX bytes:76 (76.0 b)
> *
> 
> Table de routage IP du noyau
> Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt
> Iface
> *192.168.254.254 0.0.0.0         255.255.255.255 UH        0 0          0
> ppp0*
> 192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0
> eth1
> 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0
> eth1
> 0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0
> eth1
> [r...@navette ~]#
> 
> *One more strange thing:
> When I try to stop mbuni with CTRL+C, mbuni does not want to stop: did you
> see this as well? Only solution is to kill mmsbox, kill pppd process and
> remove /var/run/ppp0.pid as well*
> 
> mmsbox.log:
> --------------------
> 2010-08-05 08:26:22 [2403] [7] INFO: mms_queue.c:1173 <mms_queue_run>
> [mms_queue] [n/a] Queue runner [/var/spool/mbuni/mmsbox_
> outgoing] goes down...
> 2010-08-05 08:26:22 [2403] [20] DEBUG: Thread 20
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [19] DEBUG: Thread 19
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [21] DEBUG: Thread 21
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [22] DEBUG: Thread 22
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [0] INFO: mmsbox_cfg.c:496
> <mmsbox_stop_mmsc_conn_real> [mmsbox] [n/a] Shutdown for mmsc [modem]
> complete
> 2010-08-05 08:26:22 [2403] [0] INFO: mms_queue.c:1173 <mms_queue_run>
> [mms_queue] [n/a] Queue runner [/var/spool/mbuni/mmsbox_incoming] goes
> down...
> 2010-08-05 08:26:22 [2403] [11] DEBUG: Thread 11
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [8] DEBUG: Thread 8 (mms_queue.c:(gwthread_func_t
> *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [9] DEBUG: Thread 9 (mms_queue.c:(gwthread_func_t
> *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [10] DEBUG: Thread 10
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [12] DEBUG: Thread 12
> (mms_queue.c:(gwthread_func_t *)tdeliver) terminates.
> 2010-08-05 08:26:22 [2403] [0] INFO: mmsbox.c:790 <main> [mmsbox] [n/a]
> Shutdown started..
> 
> ^C2010-08-05 08:26:35 [2403] [0] INFO: mmsbox.c:36 <quit_now> [mmsbox] [n/a]
> shutdown in progress...
> ^C2010-08-05 08:26:36 [2403] [0] INFO: mmsbox.c:36 <quit_now> [mmsbox] [n/a]
> shutdown in progress...
> 
> 
> BR
> 
> Emmanuel

> _______________________________________________
> Users mailing list
> Users@mbuni.org
> http://lists.mbuni.org/mailman/listinfo/users

Attachment: pgpJ00nTizHdr.pgp
Description: PGP signature

_______________________________________________
Users mailing list
Users@mbuni.org
http://lists.mbuni.org/mailman/listinfo/users

Reply via email to