MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Auto-Start Failed

    Troubleshooting
    2
    3
    1819
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jaerenull last edited by

      Hey so I’m having trouble auto-starting my magic mirror.
      I used this guide:
      https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror
      And followed it line by line.
      That being said, I dug through the forums and it seems like people were having trouble doing this in the older versions of MM but I couldn’t find anything current.
      0_1513269249162_Screen Shot 2017-12-14 at 10.33.14 AM.png

      This is what I’ve been getting. It looks fine, but the mm.sh file just doesn’t actually execute on startup. I have to manually enter
      pm2 start mm.sh
      to get the MM to actually start.

      Any help with this?

      Thanks!

      Mykle1 1 Reply Last reply Reply Quote 0
      • Mykle1
        Mykle1 Project Sponsor Module Developer @jaerenull last edited by

        @jaerenull

        It doesn’t seem as if you executed the command circled in red.
        0_1513275080332_1.PNG

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • J
          jaerenull last edited by

          So I went back and ran that sudo command.
          *
          *
          pi@raspberrypi:~/MagicMirror $ pm2 startup
          [PM2] Init System found: systemd
          [PM2] To setup the Startup Script, copy/paste the following command:
          sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
          pi@raspberrypi:~/MagicMirror $ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
          [PM2] Init System found: systemd
          Platform systemd
          Template
          [Unit]
          Description=PM2 process manager
          Documentation=https://pm2.keymetrics.io/
          After=network.target

          [Service]
          Type=forking
          User=pi
          LimitNOFILE=infinity
          LimitNPROC=infinity
          LimitCORE=infinity
          Environment=PATH=/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
          Environment=PM2_HOME=/home/pi
          PIDFile=/home/pi/pm2.pid

          ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
          ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
          ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill

          [Install]
          WantedBy=multi-user.target

          Target path
          /etc/systemd/system/pm2-pi.service
          Command list
          [ ‘systemctl enable pm2-pi’,
          ‘systemctl start pm2-pi’,
          ‘systemctl daemon-reload’,
          ‘systemctl status pm2-pi’ ]
          [PM2] Writing init configuration in /etc/systemd/system/pm2-pi.service
          [PM2] Making script booting at startup…

          Executing systemctl enable pm2-pi
          [DONE]
          Executing systemctl start pm2-pi
          [DONE]
          Executing systemctl daemon-reload
          [DONE]
          Executing systemctl status pm2-pi
          ● pm2-pi.service - PM2 process manager
          Loaded: loaded (/etc/systemd/system/pm2-pi.service; enabled; vendor preset: enabled)
          Active: active (running) since Thu 2017-12-14 16:59:48 CST; 6min ago
          Docs: https://pm2.keymetrics.io/
          Main PID: 640 (PM2 v2.9.0: God)
          CGroup: /system.slice/pm2-pi.service
          └─640 PM2 v2.9.0: God Daemon (/home/pi)

          Dec 14 16:59:48 raspberrypi pm2[425]: [PM2] Restoring processes located in /home/pi/dump.pm2
          Dec 14 16:59:48 raspberrypi pm2[425]: [PM2][ERROR] Failed to read dump file in /home/pi/dump.pm2
          Dec 14 16:59:48 raspberrypi pm2[425]: [PM2] Restoring processes located in /home/pi/dump.pm2
          Dec 14 16:59:48 raspberrypi pm2[425]: [PM2][ERROR] Failed to read dump file in /home/pi/dump.pm2.bak
          Dec 14 16:59:48 raspberrypi pm2[425]: [PM2][ERROR] No processes saved; DUMP file doesn’t exist
          Dec 14 16:59:48 raspberrypi pm2[425]: ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
          Dec 14 16:59:48 raspberrypi pm2[425]: │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
          Dec 14 16:59:48 raspberrypi pm2[425]: └──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
          Dec 14 16:59:48 raspberrypi pm2[425]: Use pm2 show to get more details about an app
          Dec 14 16:59:48 raspberrypi systemd[1]: Started PM2 process manager.
          [DONE]
          ±--------------------------------------+
          [PM2] Freeze a process list on reboot via:
          $ pm2 save

          [PM2] Remove init script via:
          $ pm2 unstartup systemd
          pi@raspberrypi:~/MagicMirror $ pm2 save
          [PM2] Spawning PM2 daemon with pm2_home=/home/pi/.pm2
          [PM2] PM2 Successfully daemonized
          [PM2] Saving current process list…
          [PM2] Successfully saved in /home/pi/.pm2/dump.pm2
          pi@raspberrypi:~/MagicMirror $ cd ~
          pi@raspberrypi:~ $ nano mm.sh
          pi@raspberrypi:~ $ chmod +x mm.sh
          pi@raspberrypi:~ $ pm2 start mm.sh
          [PM2] Starting /home/pi/mm.sh in fork_mode (1 instance)
          [PM2] Done.
          ┌──────────┬────┬──────┬──────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
          │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
          ├──────────┼────┼──────┼──────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
          │ mm │ 0 │ fork │ 1304 │ online │ 0 │ 0s │ 2% │ 2.6 MB │ pi │ disabled │
          └──────────┴────┴──────┴──────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
          Use pm2 show to get more details about an app
          pi@raspberrypi:~ $ pm2 save
          [PM2] Saving current process list…
          [PM2] Successfully saved in /home/pi/.pm2/dump.pm2
          pi@raspberrypi:~ $ sudo reboot
          *
          *
          *
          and nothing happened still…any thoughts/suggestions?

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy