Quit MagicMirror via SSH?



  • Hello!

    How do you stop running MagicMirror via SSH? I’m on a mac if that matters.

    Full disclosure, I’m a total n00b. I did look on the forums for this, but couldn’t seem to find anything. Thank you for your time!


  • Moderator

    How are you starting the mirror?
    Using pm2? -> pm2 stop



  • @yawns Thank you for your reply!

    I believe I’ve tried that method, but I can say for sure later tonight when I get home from work.

    As for whether I’m using pm2 or not, I don’t believe so, but I am not 100% certain. I setup my Pi 2b fairly generically, and then followed the “how to” in MagPi Issue #54, which doesn’t seem to mention anything about pm2.

    Ultimately, I just want to be able to make changes to the config file, and refresh the mirror without having to interface with the Pi physically. Right now, it is just an annoyance, but once it is on the wall, it would be a real pain as I won’t have any mouse/keyboard hooked up to it.

    Is this something I should be using? If so, can you please point me to a n00b friendly resource?

    Thank you!


  • Moderator

    @MattG
    This is the “official” way to schedule the MagicMirror process: https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror

    If you let us know how you start your mirror currently we will find a solution to stop/restart the process to avoid rebooting the pi.



  • @yawns said in Quit MagicMirror via SSH?:

    @MattG
    This is the “official” way to schedule the MagicMirror process: https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror

    If you let us know how you start your mirror currently we will find a solution to stop/restart the process to avoid rebooting the pi.

    Nice! Thank you for the link. This looks like it is exactly what I am looking for. Given that I’ve already setup the MM, and messed around some with the config (modules), do you think I need to wipe the pi and start over, or can I go ahead and follow the steps you linked to implement pm2?

    Regarding your question about how I interface with the mirror currently -

    Right now, I make changes via ssh, and start the mirror via ssh using ```
    DISPLAY=:0 nohup npm start &

    which loads up the mirror interface after a few seconds. To stop the mirror, I use the keyboard physically plugged into the pi and hi ctrl+Q.

    Thanks!


  • Moderator

    @MattG

    Okay. I did not test it and it is a rather cruel approach, but you could run killall -9 npm via ssh to terminate the npm process. However this would be some kind of a dirty shutdown.
    I don’t think you need to start all over again. pm2 just automates the start after booting the raspberry and gives a little comfort when dealing with logs and such. So you should be fine going ahead and add pm2 functionality.

    As an alternative or in addition you could install Remote Control and use your smartphone/tablet/pc/mac to initiate reboot/shutdown



  • @yawns

    Awesome! Thank you again! I will definitely be trying this out after work today. Cheers!


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.