changkun/midgard

automatic run midgard in background ?

Opened this issue · 2 comments

r4nchy commented

I want to run the midgard daemon in background whenever I restart my machine (all platforms)

on Linux I wasn't able to achieve by running mg on "sudo" and it isn't working. I tried even Docker doesn't work either, it says docker image not found or something

[Desktop Entry]
Name=Midgard
Type=Application
Exec=bash -c 'sleep 60;cd /home/pi/Server7/midgard && sudo mg server'
Terminal=false
Comment=midgard.
Categories=Utility;

On Windows I am unable to achieve this

I used the below commands on admin powershell windows and even on cmd terminal. The mg.exe shows its running on the Task Manager but nothing works. When I kill the process and start using "mg daemon run" then it works fine on the terminal windows.
mg daemon install
mg daemon start

Running mg status shows OK for both server and client for some reason.

What am I doing wrong ?

Hi there, for Windows, I no longer have a Windows machine to verify this. Installing a Windows virtual machine also seems inconvenient for me as this is an open-source project.
For Linux, using mg daemon install should be able to setup the automatic background running for you. If not, it might be an issue with your system environment and you need debug this by looking into system log errors, usually under in /var/log/*. So far it seems to work fine on my Linux machine.

I encourage you to investigate this issue because you are already facing it, once you figured the reason, provide a fix to reward to the open source community will be highly appreciated by anyone who will use this tool in the future.

r4nchy commented

on windows I was able to make the daemon work, on a open terminal windows. Unfortunately the windows needs to be always running for it to work

on Linux the midgard server causes similar issues, the server is able to run only when the terminal window is open. Otherwise it doesn't run