Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make anki-sync-server run in the background? #123

Open
aaro-n opened this issue Feb 10, 2022 · 2 comments
Open

How to make anki-sync-server run in the background? #123

aaro-n opened this issue Feb 10, 2022 · 2 comments

Comments

@aaro-n
Copy link

aaro-n commented Feb 10, 2022

system message

operating system

  • Debian 11

python version

  • Python 3.9.2

anki-sync-server version

  • v2.3.0(zip package downloaded directly in releases)

problems encountered

  • According to the installation instructions, you can use ssh to run anki-sync-server. Once ssh is closed, anki-sync-server cannot run. How to keep anki-sync-server running when ssh is disconnected?

try it yourself

  • Ankisyncd.conf file save location: /home/www/service/src/ankisyncd.conf
  • I tried to write a Systemd daemon myself, but it didn't work after restarting Systemd.
  • Run the code python3 -m ankisyncd in the /home/www/service/src/ directory, and execute python3 -m ./src/ankisyncd in the /home/www/service directory, it will not run,Error code: /usr/bin/python3: Relative module names not supported

My current solution

  • Install screen: sudo apt-get install screen
  • run screen -S anki
  • cd /home/www/service/src/ ,run python3 -m ankisyncd
  • Disconnect SSH

system code

[Unit]
Description=anki
After=network.target

[Service]
Type=simple
User=$USER
Restart=on-abnormal
RestartSec=5s

ExecStart=/usr/bin/python3 -m ankisyncd
WorkingDirectory=/home/www/service/src

[Install]
WantedBy=multi-user.targe

@bootymcjudy
Copy link

Looks like for python we need to import subprocess, if anyone who knows how to do can guide us how to do so or if there are any other solutions to running it detached so that I can exit out of ssh without keeping it open for the sync server

@dglava
Copy link

dglava commented Oct 18, 2022

A systemd service would be the ideal solution when using systemd. What error did you get when using your service file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants