Restarting the service after deploying a configuration
Published: July 20, 2018 - 4:26 PM
Good morning,
To begin, here is some information regarding the infrastructure:
- Installed WAPT version: 1.5
- Server OS: Linux Debian 9 Stretch
- Administration/package creation machine OS: Windows 7
- One external WAPT server and two additional local repositories on each site
My problem:
I am currently deploying my wapt-get.ini configuration using a package
This works when I add the package to a machine and allows me to modify the main repo in order to retrieve future packages from the local repo.
However, after testing, I realized that the service needed to be restarted, otherwise the retrieval of other packages is done on the externalized server's repo, therefore via HTTP.
The following command allows me to verify this:
I tried adding this little piece of code to my package:
I have the impression that my service has restarted but I still am not retrieving the packages on the local repo.
If I manually restart the service the problem is solved, but I cannot afford to go to each of the 200 machines.
Sorry for the rather long post, but I tried to summarize the situation as best I could.
Thanks in advance and have a good weekend
To begin, here is some information regarding the infrastructure:
- Installed WAPT version: 1.5
- Server OS: Linux Debian 9 Stretch
- Administration/package creation machine OS: Windows 7
- One external WAPT server and two additional local repositories on each site
My problem:
I am currently deploying my wapt-get.ini configuration using a package
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print('Modify max_gpo_script_wait')
inifile_writestring(WAPT.config_filename,'global','max_gpo_script_wait',180)
print('Modify Preshutdowntimeout')
inifile_writestring(WAPT.config_filename,'global','pre_shutdown_timeout',180)
print('Disable Hyberboot')
inifile_writestring(WAPT.config_filename,'global','hiberboot_enabled',0)
print('Disable Notify User')
inifile_writestring(WAPT.config_filename,'global','notify_user',0)
print('Verify cert')
inifile_writestring(WAPT.config_filename,'global','verify_cert',0)
print('Modify public_certs_dir')
inifile_writestring(WAPT.config_filename,'global','public_certs_dir','C:\Program Files (x86)\wapt\ssl')
print('Modify repo_url')
inifile_writestring(WAPT.config_filename,'global','repo_url','https://repolocal1/wapt')
print('Create repositories')
inifile_writestring(WAPT.config_filename,'global','repositories','repo-externe')
print('Frequence update')
inifile_writestring(WAPT.config_filename,'global','waptupdate_task_period',300)
print('Timeout server')
inifile_writestring(WAPT.config_filename,'global','wapt_server_timeout',300)
print('Interdire annulation MAJ')
inifile_writestring(WAPT.config_filename,'global','allow_cancel_upgrade',1)
print('Enable repositories')
inifile_writestring(WAPT.config_filename,'repo-externe','repo_url','https://repoexterne/wapt')
print('Verify cert secondaire')
inifile_writestring(WAPT.config_filename,'repo-externe','verify_cert',0)However, after testing, I realized that the service needed to be restarted, otherwise the retrieval of other packages is done on the externalized server's repo, therefore via HTTP.
The following command allows me to verify this:
Code: Select all
wapt-get show "paquet"I tried adding this little piece of code to my package:
Code: Select all
def service_restart(WAPTService):
logger.debug(u'Restarting service %s' % WAPTService)
win32serviceutil.RestartService(WAPTService)
win32api.Sleep(2000)
return win32serviceutil.WaitForServiceStatus(WAPTService, win32service.SERVICE_RUNNING, waitSecs=4)I have the impression that my service has restarted but I still am not retrieving the packages on the local repo.
If I manually restart the service the problem is solved, but I cannot afford to go to each of the 200 machines.
Sorry for the rather long post, but I tried to summarize the situation as best I could.
Thanks in advance and have a good weekend