Stuck on boot

Home Forums Conduit: AEP Model Stuck on boot

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #11917
    Quentin DESBOIS
    Participant

    Hi everyone,

    For my project, I created a web server on port 1337 with NodeJS in index.js file. I need to start my service automatically on startup that why I created a SH script file in /etc/init.d such as :

    (I’d like to use ‘forever’ with nodeJS but NPM is not available)

    #! /bin/sh
    # /etc/init.d/maquette_nodejs
    
    ### BEGIN INIT INFO
    # Provides:          maquette_nodejs
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Maquette NodeJS Server port 1337
    # Description:       This file should be used to construct scripts to be
    #                    placed in /etc/init.d.
    ### END INIT INFO
    
    # Carry out specific functions when asked to by the system
    case "$1" in
       start)
        echo "Starting index.js"
        /usr/bin/node /home/root/maquette/index.js >> /home/root/maquette/logfile.log
       ;;
       stop)
        echo "Stopping index.js"
        # kill application you want to stop
        killall -9 node
        # Not a great approach for running
        # multiple node instances
        ;;
      *)
        echo "Usage: /etc/init.d/maquette_nodejs {start|stop}"
        exit 1
        ;;
    esac
    
    exit 0

    Here’s the problem : When I reboot, I couldn’t access to my Multiconenct anymore with SSH. I used debug mode with USB to understand what happened.
    As which, my script is started, the boot log display “Starting index.js” but nothing after it. It seems that my service avoid the starts of the other service and stuck the multiconnect on boot …

    Can you tell me what I have to do ? Because I can’t access to my files.

    Thank you.

    Quentin.

    #11923
    Brandon Bayer
    Blocked

    Quentin,

    That’s probably because your node process isn’t being backgrounded. You could add ‘&’ right before ‘>>’, or you can use start-stop-daemon as in the below example:

    
    #!/bin/sh
    
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/sbin/radio-monitor
    NAME=radio-monitor
    ANGEL=/sbin/radio-angel
    DESC="Radio Monitor"
    PIDFILE=/var/run/radio-monitor.pid
    
    start() {
      start-stop-daemon --start --background --make-pid -p $PIDFILE --exec $ANGEL -- $DAEMON
    }
    
    stop() {
      start-stop-daemon --stop --exec $ANGEL -p $PIDFILE
      rm $PIDFILE
    }
    
    case "$1" in
      start)
        echo -n "Starting $DESC: "
        start
        echo "$NAME."
        ;;
      stop)
        echo -n "Stopping $DESC: "
        stop
        echo "$NAME."
        ;;
      restart|force-reload)
        echo -n "Restarting $DESC: "
        stop
        sleep 1
        start
        echo "$NAME."
        ;;
      *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
    esac
    
    exit 0
    

    -Brandon

    #11926
    Quentin DESBOIS
    Participant

    Ok thank you for your help.

    But NOW, can you help me to fix my boot freeze ? Because I can’t use my multiconnect … 🙁

    #11928
    Brandon Bayer
    Blocked

    Quentin,

    Oh yes. So you’ll need to follow the U-Boot firmware flashing instructions on the following page:
    http://www.multitech.net/developer/software/mlinux/using-mlinux/flashing-mlinux-firmware-for-conduit/

    Before you put add this to the boot init script again, test it from the command line and make sure the process is backgrounded (you get back to the command prompt without having to hit Ctrl-C)

    
    /etc/init.d/myapp start
    

    -Brandon

    #11933
    Quentin DESBOIS
    Participant

    I follow your instructions,

    I set the environnement variable on Uboot,
    I success to download the 2 files from here : http://www.multitech.net/mlinux/images/3.1.0/mtcdt/
    and upload its to Multiconnect with TFTP

    Then I ran manualy the command from http://git.multitech.net/cgi-bin/cgit.cgi/meta-multitech.git/plain/contrib/uboot-setenv-mtcdt.minicom
    (because syntax error)

    All seems worked well, but when I ‘boot’, the boot log display :

    ip_tables: (C) 2000-2006 Netfilter Core Team
    TCP: cubic registered
    NET: Registered protocol family 17
    l2tp_core: L2TP core driver, V2.0
    Key type dns_resolver registered
    at91_rtc fffffeb0.rtc: setting system clock to 2016-03-21 16:40:19 UTC (1458578419)
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
    CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.27 #1
    [<c000d580>] (unwind_backtrace+0x0/0xe0) from [<c000bb6c>] (show_stack+0x10/0x14)
    [<c000bb6c>] (show_stack+0x10/0x14) from [<c03a39ac>] (panic+0x78/0x1bc)
    [<c03a39ac>] (panic+0x78/0x1bc) from [<c04eff54>] (mount_block_root+0x208/0x250)
    [<c04eff54>] (mount_block_root+0x208/0x250) from [<c04f0170>] (mount_root+0xdc/0x104)
    [<c04f0170>] (mount_root+0xdc/0x104) from [<c04f02f0>] (prepare_namespace+0x158/0x1b8)
    [<c04f02f0>] (prepare_namespace+0x158/0x1b8) from [<c04efb78>] (kernel_init_freeable+0x174/0x1b8)
    [<c04efb78>] (kernel_init_freeable+0x174/0x1b8) from [<c03a24d4>] (kernel_init+0x8/0xe4)
    [<c03a24d4>] (kernel_init+0x8/0xe4) from [<c00094f0>] (ret_from_fork+0x14/0x24)
    

    I think problem is here :

    Because i got syntax error, I replaced :

    setenv bootcmd \'nboot.jffs2 ${loadaddr} 0 ${kernel_addr} && bootm ${loadaddr}\'

    by

    setenv bootcmd nboot.jffs2 ${loadaddr} 0 ${kernel_addr} && bootm ${loadaddr}

    How did I avoid the syntax error message on uBoot ?

    #11934
    Brandon Bayer
    Blocked

    Quentin,

    Did you set the env variables before flashing (issuing run krb)?

    You’ll need to start over and carefully go through the U-Boot flashing instructions again. You shouldn’t need to modify the script before running it in Minicom. In any case, the quotes (') around the commands are critical (you removed them).

    -Brandon

    #11935
    Quentin DESBOIS
    Participant

    Hi Brandon,

    Because my development PC is on Windows, I use Putty to connect with COM Serial Port but as I said, I get a syntax error.
    This time, I try to set the environment variable with Real Term using Send Ascii function and it seems to work.

    Then I run krb, and instalation is complete.

    Now my question is : From my MLinux Model, How to get AEP Model ? And what is the main difference between both version ?

    Thank you 🙂

    #11936
    Brandon Bayer
    Blocked

    Quentin,

    Ok, I’m glad you got that to work! mLinux doesn’t have the web GUI or Node-RED. If want AEP again, you’ll need to open a support case and ask for the AEP upgrade files. Then follow the mLinux flashing instructions (auto-flash, not U-boot) using the AEP files.

    -Brandon

    #11937
    Quentin DESBOIS
    Participant

    Thank you Brandon,

    All works fine !

    1) Flash Kernel (uImage.bin) and rootfs (rootfs.jffs2) to mLinux
    2) Upgrade from mLinux to AEP model
    3) Upgrade AEP firmware to the last version 1.1.2 (including NPM)
    4) Set up firewall to open 1337 port by adding iptables instructions just after firewall –init in /etc/init.d/firewall

    Thanks again 😀

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.