MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Starting mirror with PM2 on boot

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 2 Posters 2.4k Views 2 Watching
    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.
    • E Offline
      eitan @sdetweil
      last edited by

      @sdetweil

      Thank you for your replay.

      Yes, Magic Mirror starts with npm start,
      It also starts with PM2, when running it after boot - pm2 start mm.
      what I have not been able to do is for it to start automatically after boot.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @eitan
        last edited by

        @eitan ok, I have not used the install instructions for pm2,
        as I have an install script that does all the work ,

        you can use the fixuppm2 script
        it uses a different mm.sh, whcih we ship, in the MagicMirror/installers folder

        see this
        https://github.com/sdetweil/MagicMirror_scripts?tab=readme-ov-file#add-using-pm2-to-autostart-magicmirror-at-bootup

        you will have to delete one of the entries from pm2 after this so you don’t try to start 2.

        see

        pm2 --help
        

        for the command syntax

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          eitan @sdetweil
          last edited by

          @sdetweil

          Hi sdetweil (as I don’t have your name),

          Thank you, this worked perfect.
          I ran the script, afterwards PM2 had a second line in it named MagicMirror.
          PM2.JPG I deleted my own mm line (PM2 delete mm) and was left with only MagicMirror in PM2
          PM2_2.JPG
          Stopped started the MagicMirror with PM2 and got an warning from PM2 about the incorrect mm:
          [PM2][WARN] Current process list is not synchronized with saved list. App mm differs. Type ‘pm2 save’ to synchronize.
          Saved the new status PM2 save
          Rebooted the Pi and MagicMirror was up after boot.

          I was wondering if you can share the content of MagicMirror.sh (if it is an .sh script), so that I can understand what’s the different

          In any case, thank you

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @eitan
            last edited by

            @eitan my name is in each of my replies.

            the script is ~/MagicMirror/installers/mm.sh

            you can also give pm2 a json file with a more descriptive name.

            see the file I create
            ~/MagicMirror/installers/pm2_magicmirror.json

            see pm2 --help for all the things it can do

            by convention, each command is to provide help 2 ways.

            one in response to the only Parm --help and some usage man(ual) page(s)

            so

            man pm2 
            

            will.open that for pm2

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            E 1 Reply Last reply Reply Quote 0
            • E Offline
              eitan @sdetweil
              last edited by

              @sdetweil

              Thank you Sam, for all your help.

              I can close the issue now.

              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 Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy