revision for filenames, explained new options

Matteo ℱan
2019-06-12 00:05:35 +02:00
parent cba0b35e47
commit 5836bd23de

@@ -323,7 +323,7 @@ where command line options are:
## py-kms Usage ## py-kms Usage
#### _How to run server.py manually_. #### _How to run pykms_Server.py manually_.
*** ***
A Linux user with ```ifconfig``` command can get his KMS IP ( Windows users can try ```ipconfig /all```). A Linux user with ```ifconfig``` command can get his KMS IP ( Windows users can try ```ipconfig /all```).
``` ```
@@ -344,12 +344,12 @@ lo Link encap: Local Loopback
``` ```
In the example above is 192.168.1.102, so is valid: In the example above is 192.168.1.102, so is valid:
```user@user ~/path/to/folder/py-kms $ python server.py 192.168.1.102 1688``` ```user@user ~/path/to/folder/py-kms $ python pykms_Server.py 192.168.1.102 1688```
To stop _server.py_, in the same bash window where code running, more simply press CTRL+C. To stop _pykms_Server.py_, in the same bash window where code running, simply press CTRL+C.
Alternatively use ```kill <pid>``` command ( you can type ```ps aux``` first and have the process <pid> ) or ```killall <name_of_server>``` in a new bash window. Alternatively, in a new bash window, use ```kill <pid>``` command ( you can type ```ps aux``` first and have the process <pid> ) or ```killall <name_of_server>```.
#### _How to run server.py automatically at start_. #### _How to run pykms_Server.py automatically at start_.
*** ***
If you are running a Linux distro that is using ```upstart```, you can simply manage a daemon that runs as a background process. If you are running a Linux distro that is using ```upstart```, you can simply manage a daemon that runs as a background process.
@@ -358,20 +358,20 @@ If you are running a Linux distro that is using ```upstart```, you can simply ma
Then add the following ( changing where necessary ) and save file: Then add the following ( changing where necessary ) and save file:
``` ```
description "py-kms" description "py-kms"
author "myanaloglife" author "SystemRage"
env PYTHON_HOME=/<dir> env PYTHON_HOME=/<dir>
env PATH=$PYTHON_HOME:$PATH env PATH=$PYTHON_HOME:$PATH
start on runlevel [2345] start on runlevel [2345]
stop on runlevel [016] stop on runlevel [016]
chdir /home/user/path/to/py-kms chdir /home/user/path/to/py-kms
exec $PYTHON_HOME/bin/python server.py <server address> <server port> -v DEBUG --logfile /var/log/py-kms_server.log exec $PYTHON_HOME/bin/python pykms_Server.py <server address> <server port> -v DEBUG --logfile /var/log/pykms_logserver.log
respawn respawn
``` ```
Confirm that it looks ok with: ```init-checkconf /etc/init/py-kms.conf``` and reload configuration: ```initctl reload-configuration``` Confirm that it looks ok with: ```init-checkconf /etc/init/py-kms.conf``` and reload configuration: ```initctl reload-configuration```
Now reboot the machine ```sudo reboot``` and when you boot up your system, you can see the log file stating that your daemon is running : Now reboot the machine ```sudo reboot``` and when you boot up your system, you can see the log file stating that your daemon is running :
```cat /var/log/py-kms_server.log```. ```cat /var/log/pykms_logserver.log```.
Finally a few commands useful for the status of your daemon: Finally a few commands useful for the status of your daemon:
* restart --> this will stop, then start a service: ```sudo service py-kms restart``` * restart --> this will stop, then start a service: ```sudo service py-kms restart```
@@ -381,7 +381,7 @@ Finally a few commands useful for the status of your daemon:
According to OS that you are running, you can also create a daemon with ```systemd``` or ```SysV```. According to OS that you are running, you can also create a daemon with ```systemd``` or ```SysV```.
If you are using Windows, to run _server.py_ as service you need to install [pywin32](https://sourceforge.net/projects/pywin32/) then you can create a file for example named _kms-winservice.py_ and put into it this code: If you are using Windows, to run _pykms_Server.py_ as service you need to install [pywin32](https://sourceforge.net/projects/pywin32/) then you can create a file for example named _kms-winservice.py_ and put into it this code:
``` ```
import win32serviceutil import win32serviceutil
@@ -395,7 +395,7 @@ class AppServerSvc (win32serviceutil.ServiceFramework):
_svc_name_ = "py-kms" _svc_name_ = "py-kms"
_svc_display_name_ = "py-kms" _svc_display_name_ = "py-kms"
_proc = None _proc = None
_cmd = ["C:\Windows\Python27\python.exe", "C:\Windows\Python27\py-kms\server.py"] _cmd = ["C:\Windows\Python27\python.exe", "C:\Windows\Python27\py-kms\pykms_Server.py"]
def __init__(self,args): def __init__(self,args):
win32serviceutil.ServiceFramework.__init__(self,args) win32serviceutil.ServiceFramework.__init__(self,args)
@@ -427,7 +427,7 @@ Now in a command prompt type ```C:\Windows\Python27\python.exe kms-winservice.py
Display all the services with ```services.msc``` and find the service associated with _py-kms_, changing startup type from "manual" to "auto". Finally "Start" the service. Display all the services with ```services.msc``` and find the service associated with _py-kms_, changing startup type from "manual" to "auto". Finally "Start" the service.
If this approach fails, you can try to use the [Non-Sucking Service Manager](https://nssm.cc/) or Task Scheduler as described [here](https://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/). If this approach fails, you can try to use the [Non-Sucking Service Manager](https://nssm.cc/) or Task Scheduler as described [here](https://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/).
#### _server.py Options_. #### _pykms_Server.py Options_.
*** ***
Follows a list of usable parameters: Follows a list of usable parameters:
@@ -475,8 +475,8 @@ Follows a list of usable parameters:
( big endian ). Default is "364F463A8863D35F". To auto generate the HWID, type "random". ( big endian ). Default is "364F463A8863D35F". To auto generate the HWID, type "random".
-c or --client-count <CLIENTCOUNT> -c or --client-count <CLIENTCOUNT>
Use this flag to specify the current CLIENTCOUNT. Default is 26. Remember that a number >25 is Use this flag to specify the current CLIENTCOUNT. Default is None. Remember that a number >=25 is
required to enable activation. required to enable activation of client OSes while for server OSes and Office >=5.
-a or --activation-interval <ACTIVATIONINTERVAL> -a or --activation-interval <ACTIVATIONINTERVAL>
Instructs clients to retry activation every ACTIVATIONINTERVAL minutes if it was unsuccessful, Instructs clients to retry activation every ACTIVATIONINTERVAL minutes if it was unsuccessful,
@@ -489,7 +489,10 @@ Follows a list of usable parameters:
-s or --sqlite -s or --sqlite
Use this option to store request information from unique clients in an SQLite database. Use this option to store request information from unique clients in an SQLite database.
-V or --loglevel <{CRITICAL, ERROR, WARNING, INFO, DEBUG}> -t or --timeout <TIMEOUT>
Disconnect clients after time of inactivity ( in seconds ). The default is 30 seconds.
-V or --loglevel <{CRITICAL, ERROR, WARNING, INFO, DEBUG, MINI}>
Activate verbose logging. Use this flag to set a loglevel. The default is ERROR. Activate verbose logging. Use this flag to set a loglevel. The default is ERROR.
( example: user@user ~/path/to/folder/py-kms $ python pykms_Server.py -V INFO ( example: user@user ~/path/to/folder/py-kms $ python pykms_Server.py -V INFO
@@ -497,8 +500,8 @@ Follows a list of usable parameters:
Mon, 12 Jun 2017 22:09:00 INFO TCP server listening at 0.0.0.0 on port 1688. Mon, 12 Jun 2017 22:09:00 INFO TCP server listening at 0.0.0.0 on port 1688.
Mon, 12 Jun 2017 22:09:00 INFO HWID: 364F463A8863D35F ) Mon, 12 Jun 2017 22:09:00 INFO HWID: 364F463A8863D35F )
-F of --logfile <LOGFILE> -F or --logfile <LOGFILE>
Create a "LOGFILE.log" logging file. The default is named "pykms_logserver.log" Create a "LOGFILE.log" logging file. The default is named "pykms_logserver.log".
( example: user@user ~/path/to/folder/py-kms $ python pykms_Server.py 192.168.1.102 8080 ( example: user@user ~/path/to/folder/py-kms $ python pykms_Server.py 192.168.1.102 8080
-F ~/path/to/folder/py-kms/newfile.log -V INFO -w random -F ~/path/to/folder/py-kms/newfile.log -V INFO -w random
@@ -506,7 +509,10 @@ Follows a list of usable parameters:
Mon, 12 Jun 2017 22:09:00 INFO TCP server listening at 192.168.1.102 on port 8080. Mon, 12 Jun 2017 22:09:00 INFO TCP server listening at 192.168.1.102 on port 8080.
Mon, 12 Jun 2017 22:09:00 INFO HWID: 58C4F4E53AE14224 ) Mon, 12 Jun 2017 22:09:00 INFO HWID: 58C4F4E53AE14224 )
#### _client.py Options_. -S or --logsize <MAXSIZE>
Use this flag to set a maximum size ( in MB ) to the output log file. Desactivated by default.
#### _pykms_Client.py Options_.
*** ***
If something does not work, it may have the cause that _py-kms_ server does not work correctly. You can test this with the KMS client _pykms_Client.py_, running on the same machine where you started _pykms_Server.py_. If something does not work, it may have the cause that _py-kms_ server does not work correctly. You can test this with the KMS client _pykms_Client.py_, running on the same machine where you started _pykms_Server.py_.
For example ( in separated bash windows ) run these commands: For example ( in separated bash windows ) run these commands:
@@ -548,12 +554,15 @@ You can also put further parameters as defined below:
Use this flag to manually specify an ASCII MACHINENAME to use. If no MACHINENAME is specified Use this flag to manually specify an ASCII MACHINENAME to use. If no MACHINENAME is specified
a random one will be generated. a random one will be generated.
-V or --loglevel <{CRITICAL, ERROR, WARNING, INFO, DEBUG}> -V or --loglevel <{CRITICAL, ERROR, WARNING, INFO, DEBUG, MINI}>
Activate verbose logging. Use this flag to set a loglevel. The default is ERROR. Activate verbose logging. Use this flag to set a loglevel. The default is ERROR.
-F of --logfile <LOGFILE> -F of --logfile <LOGFILE>
Create a "LOGFILE.log" logging file. The default is named "pykms_logclient.log". Create a "LOGFILE.log" logging file. The default is named "pykms_logclient.log".
-S or --logsize <MAXSIZE>
Use this flag to set a maximum size ( in MB ) to the output log file. Desactivated by default.
## Activation Procedure ## Activation Procedure
Briefly the product asks for a key during installation, so it needs to enter the GVLK. Then user can set connection parameters, while KMS server must already be running on server machine. Finally with specific commands activation occurs automatically and can be extended later every time for another 180 ( or 45 ) days. Briefly the product asks for a key during installation, so it needs to enter the GVLK. Then user can set connection parameters, while KMS server must already be running on server machine. Finally with specific commands activation occurs automatically and can be extended later every time for another 180 ( or 45 ) days.