SystemRage / py-kms

KMS Server Emulator written in Python
The Unlicense
2.07k stars 634 forks source link

Auto start py-KMS as a background process in Arch based distro (Manjaro) #46

Closed sobuj53 closed 4 years ago

sobuj53 commented 4 years ago

Hey many thanks for the Py-KMS. It's working out of the box. I'm running a Arch based Linux distro (Manjaro) that is using systemd. When I try to run sudo nano /etc/init/py-kms.conf it'll not update the entry, as

/etc/init/

doesn't exist in Manjaro or Arch based distro it has

/etc/init.d/

Can you please help me regarding how to manage a daemon that runs as a background process for py-kms in Arch based distro?

sobuj53 commented 4 years ago

Ok I've found the solution, For those who are interested to run py-kms at system start in Arch based distro eg. Manjaro, have a look at, https://github.com/SystemRage/py-kms/issues/4#issuecomment-427515825 I some what modified the script like this, Create a KMS_log folder in Home folder and did the following,

sudo nano /lib/systemd/system/py3-kms.service paste following contents

[Unit]
Description=py3-kms
After=network.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/python3 /opt/py-kms-master/py-kms/pykms_Server.py 127.0.0.2 1688 --loglevel DEBUG --logfile /home/<username>/KMS_Log/pykms_logserver.log --logsize 2
Restart=always
KillMode=process
Type=idle
User=<current_user>
Group=<current_user_group>

[Install]
WantedBy=multi-user.target

please adjust and as necessary you can find it using, groups

For newbie like me don't forget to create py3-kms folder in /opt and place py-kms-master/py-kms in the location :)