mirror of https://github.com/SystemRage/py-kms.git
Reformatting...
This commit is contained in:
parent
28bf445127
commit
ba535736a2
|
@ -49,10 +49,8 @@ respawn
|
||||||
Check syntax with: `sudo init-checkconf -d /etc/init/py3-kms.conf`, then reload upstart to recognise this process: `sudo initctl reload-configuration`.
|
Check syntax with: `sudo init-checkconf -d /etc/init/py3-kms.conf`, then reload upstart to recognise this process: `sudo initctl reload-configuration`.
|
||||||
Now start the service: `sudo start py3-kms`, and you can see the logfile stating that your daemon is running: `cat </path/to/your/log/files/folder>/pykms_logserver.log`.
|
Now start the service: `sudo start py3-kms`, and you can see the logfile stating that your daemon is running: `cat </path/to/your/log/files/folder>/pykms_logserver.log`.
|
||||||
|
|
||||||
If you are running a Linux distro using ```systemd```,
|
If you are running a Linux distro using `systemd`, create the file: `sudo nano /etc/systemd/system/py3-kms.service`, then add the following (changing where needed) and save:
|
||||||
create the file: ```sudo nano /etc/systemd/system/py3-kms.service```,
|
```systemd
|
||||||
then add the following (changing where needed) and save:
|
|
||||||
```
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=py3-kms
|
Description=py3-kms
|
||||||
After=network.target
|
After=network.target
|
||||||
|
@ -69,18 +67,15 @@ ExecStart=/usr/bin/python3 </path/to/your/pykms/files/folder>/py-kms/pykms_Serve
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
Check syntax with: ```sudo systemd-analyze verify py3-kms.service```,
|
Check syntax with: `sudo systemd-analyze verify py3-kms.service`, give file permission (if needed): `sudo chmod 644 /etc/systemd/system/py3-kms.service`, then reload systemd manager configuration: `sudo systemctl daemon-reload`,
|
||||||
give file permission (if needed): ```sudo chmod 644 /etc/systemd/system/py3-kms.service```,
|
and start the daemon: `sudo systemctl start py3-kms.service` and view status: `sudo systemctl status py3-kms.service`.
|
||||||
then reload systemd manager configuration: ```sudo systemctl daemon-reload```,
|
Check if daemon is correctly running: `cat </path/to/your/log/files/folder>/pykms_logserver.log`.
|
||||||
start daemon: ```sudo systemctl start py3-kms.service``` and view status: ```sudo systemctl status py3-kms.service```.
|
|
||||||
Check if daemon is correctly running: ```cat </path/to/your/log/files/folder>/pykms_logserver.log```.
|
|
||||||
|
|
||||||
You can also create a daemon with ```SysV``` (obsolete).
|
You can also create a daemon with `SysV` (obsolete).
|
||||||
Finally a few generic commands useful for interact with your daemon: [here](https://eopio.com/linux-upstart-process-manager/) and [here](https://linoxide.com/linux-how-to/enable-disable-services-ubuntu-systemd-upstart/)
|
Finally a few generic commands useful for interact with your daemon: [here](https://eopio.com/linux-upstart-process-manager/) and [here](https://linoxide.com/linux-how-to/enable-disable-services-ubuntu-systemd-upstart/)
|
||||||
|
|
||||||
If you are using Windows, to run _pykms_Server.py_ as service you need to install [pywin32](https://sourceforge.net/projects/pywin32/),
|
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:
|
||||||
then you can create a file for example named _kms-winservice.py_ and put into it this code:
|
```python
|
||||||
```
|
|
||||||
import win32serviceutil
|
import win32serviceutil
|
||||||
import win32service
|
import win32service
|
||||||
import win32event
|
import win32event
|
||||||
|
@ -120,10 +115,8 @@ class AppServerSvc (win32serviceutil.ServiceFramework):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
win32serviceutil.HandleCommandLine(AppServerSvc)
|
win32serviceutil.HandleCommandLine(AppServerSvc)
|
||||||
```
|
```
|
||||||
Now in a command prompt type ```C:\Windows\Python27\python.exe kms-winservice.py install``` to install the service.
|
Now in a command prompt type `C:\Windows\Python27\python.exe kms-winservice.py install` to install the service. Display all the services with `services.msc` and find the service associated with _py-kms_, change the startup type
|
||||||
Display all the services with ```services.msc``` and find the service associated with _py-kms_, changing startup type from "manual" to "auto".
|
from `manual` to `auto`. Finally `Start` the service. If this approach fails, you can try to use [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/).
|
||||||
Finally "Start" the service.
|
|
||||||
If this approach fails, you can try to use [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/).
|
|
||||||
|
|
||||||
## _pykms_Server.py Options_.
|
## _pykms_Server.py Options_.
|
||||||
***
|
***
|
||||||
|
|
Loading…
Reference in New Issue