When trying to install a setup package using the new MSI 5.0 features of Windows Service Configuration (using Tables: MsiServiceConfig / MsiServiceConfigFailureActions)
the service config fails and results in a rollback.
The service itself is installed along with the same package under "LocalSystem" account.
Regarding MSDN, these feature does have some limitations, but I am not sure if they are applicable here:
"The services configuration feature of the Windows Installer cannot configure network service accounts, install shared service host (svchost) processes, or restart services stopped as part of the installation"
(see http://msdn.microsoft.com/en-us/library/windows/desktop/dd408113(v=vs.85).aspx )
I have tried this with several variations on the failure actions count and type.
Using SC_ACTION_NONE or SC_ACTION_RUN_COMMAND actions indeed work and lead to a successful install.
Can you tell, why SC_ACTION_RESTART or SC_ACTION_REBOOT does not work fine?
MSI Log File excerpt:
Action 08:21:51: InstallServices. Installing new services
MSI (s) (78:74) [08:21:51:828]: Executing op: ProgressTotal(Total=5,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:51:859]: Executing op: ServiceInstall(Name=PCSProxy,DisplayName=Protection Communication System Proxy,ImagePath="C:\Program Files (x86)\Protection Communication System\Pcs.Proxy.Service.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies=[~],,,Password=**********,Description=Provides limited write access to the PPS,,)
InstallServices: Service:
MSI (s) (78:74) [08:21:52:218]: Executing op: ActionStart(Name=MsiConfigureServices,,)
Action 08:21:52: MsiConfigureServices.
MSI (s) (78:74) [08:21:52:280]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:280]: Executing op: ServiceConfigure(,Name=PCSProxy,Event=1,ConfigType=4,Argument=1)
MSI (s) (78:74) [08:21:52:280]: Changing configuration of service PCSProxy.
MSI (s) (78:74) [08:21:52:280]: Changed configuration of service PCSProxy with ConfigType SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
MSI (s) (78:74) [08:21:52:358]: Done changing configuration of service PCSProxy
MSI (s) (78:74) [08:21:52:358]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:358]: Executing op: ServiceConfigureFailureAction(,Name=PCSProxy,Event=1,ResetPeriod=259200,RebootMessage=Rebooting the system,Command=cmd.exe,Actions=1[~]2[~]3,DelayActions=60000[~]60000[~]60000)
MSI (s) (78:74) [08:21:52:374]: Changing configuration of failure action for service PCSProxy.
MSI (s) (78:74) [08:21:52:374]: Error: 5. Failed to change current configuration of failure action for service PCSProxy
MSI (s) (78:74) [08:21:52:374]: Failed to change configuration of failure action for service PCSProxy
Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
MSI (s) (78:74) [08:22:04:791]: Product: Protection Communication System -- Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured. This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
Action ended 08:22:04: InstallFinalize. Return value 3.
[...]
Property(C): VersionNT = 602
Property(C): VersionDatabase = 500
Property(C): VersionMsi = 5.00
Property(C): VersionNT64 = 602
Property(C): WindowsBuild = 9200
Property(C): ServicePackLevel = 0
Property(C): ServicePackLevelMinor = 0
Property(C): MsiNTProductType = 3
Property(C): UserLanguageID = 1031
Property(C): ComputerName = WIN-D4AOTTU5CRV
Property(C): SystemLanguageID = 1031
Property(C): Time = 07:33:17
Property(C): Date = 18.04.2013
Property(C): MsiNetAssemblySupport = 4.0.30319.17929
Property(C): MsiWin32AssemblySupport = 6.2.9200.16384
Related
I'm running apache-jena-fuseki-3.13-1 and just found tdb2.tdbcompact from its bin-directory. I should run tdb2.tdbcompact nightly to prevent my jena-fuseki from running out of disk space, but now I get error message( Failed to get a lock: file) when running it:
miettinj#ramen:~/jena> ./apache-jena-3.13.1/bin/tdb2.tdbcompact --loc=./apache-jena-fuseki- 3.13.1/run/databases/test_TDB2
org.apache.jena.dboe.DBOpEnvException: Failed to get a lock: file='/srv/work/miettinj/jena/apache-jena-fuseki-3.13.1/run/databases/test_TDB2/tdb.lock': held by process 6136
ps -x|grep 6136
6136 ? Sl 30:48 /usr/lib64/jvm/java/bin/java -Xmx1200M -cp /srv/work/miettinj/jena/apache-jena-fuseki-3.13.1/fuseki-server.jar
"held by process 6136"
Another process is using the database. Compaction has to happen from the process using the database.
Apache Jena Fuseki Jena 3.17.0 added a function endpoint so that the administrator can ask for compaction on a running Fuseki server.
I'm learning developing drivers with win10 1709 and visual studio 2017. I created a empty wdm project and build it into mydriver1.sys
But I can't start service
sc create mydriver binpath= mydriver1.sys type= kernel
[SC] CreateService SUCCESS
sc start mydriver
[SC] StartService FAILED 2:
Then I checked the mydriver1.sys with Dependency Walker, it shows that many sys files and dll are missing.
1
How shall I solve is Problem. I don't think downloading those dlls one by one is a good idea.
My Code is a simple Hello world:
#include <ntddk.h>
VOID Unload(IN PDRIVER_OBJECT DriverObject)
{
KdPrint(("Good bye Driver\n"));
}
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
KdPrint(("Hello Driver\n"));
DriverObject->DriverUnload = Unload;
return STATUS_SUCCESS;
}
I am trying to use the Ruby on Rails Rake command to migrate to an Oracle database. My database.yml file contains the following:
development:
adapter: oracle
database: album_development
sid: orc1
username: system
password: root
On my PC I have set ORACLE_SID=orcl.
When I run Rake,migrate, I get the following error:
rake aborted!
The driver encountered an error: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Can you tell me if I need to modify my listener.ora file to get this to work? My listener.ora file is as follows:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Lenovo-PC)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
The output of the lsnrctl Status command is as follows:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
Start Date 21-APR-2016 11:14:15
Uptime 0 days 0 hr. 7 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\Lenovo-PC\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lenovo-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Lenovo-PC)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
Can anyone help / make a suggestion?
firstly you can check the database is accessible by using the TNSPING command
e.g: TNSPING xe
could it be you have used a one rather than an L sid: orc1 should be sid: orcl perhaps ?
Kevin,
Thanks for your help. I changed my database.yml to:
development:
adapter: oracle
database: xe
username: system
password: root
This allowed me to connect to the database. I now have another problem, but I think I can tackle that one. Kind regards, Sean
I am creating an MSI package for installing and starting Windows services using WiX v3.8. The code as follows:
<Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes">
<File Id="ApsService.exe"
Name="ApsService.exe"
Source="Resource\ApsService.exe"
KeyPath="yes"
Vital="yes"
DiskId="1"></File>
<ServiceInstall Id="ApsServiceInstaller"
Name="ApsService"
DisplayName="ApsService"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Description="A monitor service for windows application."
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]"
Vital="yes"
Interactive="no"></ServiceInstall>
<ServiceControl Id="StartService"
Start="install"
Stop="both"
Remove="uninstall"
Name="ApsService"
Wait="yes"/>
</Component>
But install fails with the following errors in the log:
Executing op: ServiceControl(,Name=ApsService,Action=1,Wait=1,)
StartServices: Service: ApsService
Error 1920. Service 'ApsService' (ApsService) failed to start. Verify that you have sufficient privileges to start system services.
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3676 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1888 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1764 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3504 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 2100 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 2752 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3672 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3876 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1400 could not be cancelled. Error: 1168
MSI (s) (F0:C0) [15:57:28:630]: Product: WinApsSetup64 -- Error 1920. Service 'ApsService' (ApsService) failed to start. Verify that you have sufficient privileges to start system services.
How can I fix the errors?
The error message you are getting is the generic message the Windows Installer sends when it fails to start a service during install. Almost always the issue is that the Service is missing a dependency or otherwise not fully configured when the start occurs. To debug the root issue try:
Install the MSI package.
When the error dialog comes up indicating there is a failure to start the service *do not dismiss the dialog.
Start services.msc or use sc.exe from the command-line to attempt to start your service. The Windows Installer should have configured enough of the service to be able to debug deeper why it failed.
If necessary debug into your service executable directly to see why it cannot be started.
If this is a service written in managed code, ensure that it does not depend on files being placed in the GAC. Files are not in the GAC until very, very late during the installation process. If you must use files in the GAC, you will not be able to use the built-in ServiceControl element and will have to write a custom action to run after InstallFinalize. Note that after InstallFinalize a custom action will not be elevated so your service will have to support being started by non-elevated users. Again, I recommend not depending on the GAC.
Good luck debugging your service!
The ServiceInstall Account is obfuscated in the OP's example, but this error can happen if one forgets to fully qualify the account, as such:
<ServiceInstall ... Account="NT AUTHORITY\LocalService" />
Your installer will fail if you only specify the username (w/o the NT Authority) like this:
<ServiceInstall ... Account="LocalService" />
Remember to add "Log on as a service" rights to the [SERVICEACCOUNT],
To add the "Log on as a service" right to an account on your local computer
1) Open Local Security Policy.
2) In the console tree, double-click Local Policies, and then click User Rights Assignments.
3) In the details pane, double-click Log on as a service.
4) Click Add User or Group, and then add the appropriate account to the list of accounts that possess the Log on as a service right.
From: http://technet.microsoft.com/en-us/library/cc739424%28v=ws.10%29.aspx.
When debugging a service startup issue, I always just use a simple if() statement that checks for the existence of a particular file in the installation directory. When the service fails, I open a command prompt (before dismissing the dialog indicating the failure) and use "echo >thatfile" to create the file that I am looking for in the if(). The object of the if() is the Debugger.Launch() invocation.
Now, I can dismiss the dialog and rerun the installer and this time it will start the debugger and I can see what happens. I tend to use static class init as the moment to launch the debugger, but you can try to do it in "OnStart()", but if there are loading/binding issues, you probably won't get to that point before it dies. Whereas doing it during static class init will almost always tell you the things that you need to address as dependencies.
So I got this error today because my service had dependencies that had to be GACed before starting the service. As it turns out, dependencies are GACed last by the installer, and there's really no good way to get around this without building some kind of bootstraper/multipart installer.
However, I found the following resolution: deploy the assemblies both to the GAC and install them in the same directory as the service. This way, the service will be able to find the DLLs on start in the program files directory, and they will be GACed (which was a requirement for other reasons).
To do this, I had to create two separate component groups, and a "dummy" Directory:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="NameOfProgram" />
<Directory Id="GacDlls" Name="libs" />
</Directory>
</Directory>
I then create two Component Groups: one that has the exe and all libraries, and a second with the same libraries with the Assembly attribute set to ".net":
<ComponentGroup Id="ServiceLibs" Directory="GACDlls">
<Component Id="log4netGAC"
Guid="a23099ac-5880-4b6e-af3f-fa7cef113226">
<File Id="log4net.dllGAC"
Name="log4net.dll"
Source="..\ProjectDir\bin\$(var.Configuration)\log4net.dll"
KeyPath="yes"
Vital="yes"
DiskId="1"
Assembly=".net"
/>
</Component>
</ComponentGroup>
<ComponentGroup Id="ProductComponents" Directory="INSTALLDIR">
<Component Id="log4net"
Guid="463e05db-e248-44d7-bbde-467358b7310f">
<!-- normally we'd want to GAC this (Assembly=".net"), but that would prevent us from starting the service up during install so we'll just drop it in the program folder -->
<File Id="log4net.dll"
Name="log4net.dll"
Source="..\ProjectName\bin\$(var.Configuration)\log4net.dll"
KeyPath="yes"
Vital="yes"
DiskId="1"
/>
</Component>
... other components ...
</ComponentGroup>
And now it works!
I was also having this issue, an error kept occurring during installation even though the service registry keys were created and I was able to manually start the service.
So I solved it this way:
Instead of starting the service right at installation with the Service control:
<ServiceControl Id="StartService"
Start="install"
.. />
I just removed Start from the ServiceControl so the installer's success is not dependent on the service being started. You just need to start the service manually after successful installation which can be done easilly with a script.
I'm trying to write a stand alone jython JMX client to monitor WebSphere Application Server. It connects to the DMGR using SOAP and SSL.
The code works when running it w/ WSADMIN, but fails when trying to run it as a stand alone jython client. This makes me believe the code is correct and that I'm missing a JAR or configuration file when trying to run it as a stand alone client. Also, this works w/ SSL disabled.
I have the following questions:
How can I establish the connection with security enabled (so with SSL)?
How can I make my client run from another machine? (which jars are needed?)
WAS Version:
7.0.0.21 ND on Solaris
import java.util.Properties as Properties
import javax.management.ObjectName as ObjectName
import com.ibm.websphere.management.AdminClient as AdminClient
import com.ibm.websphere.management.AdminClientFactory as AdminClientFactory
class DeploymentManager:
def __init__(self, host, soapport, user, password):
self.host = host
self.soapport = soapport
self.user = user
self.password = password
def create_admin_client(dmgrhost, dmgrsoapport, user, password):
props = Properties()
props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP)
props.setProperty(AdminClient.CONNECTOR_HOST, dmgrhost)
props.setProperty(AdminClient.CONNECTOR_PORT, dmgrsoapport)
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
props.setProperty(AdminClient.USERNAME, user);
props.setProperty(AdminClient.PASSWORD, password);
props.setProperty("javax.net.ssl.trustStore",
"/opt/IBM/Profiles/dmgr01/etc/DummyClientTrustFile.jks");
props.setProperty("javax.net.ssl.keyStore",
"/opt/IBM/Profiles/dmgr01/etc/DummyClientKeyFile.jks");
adminClient = AdminClientFactory.createAdminClient(props)
return adminClient
def get_servers():
servers = [s for s in adminClient.queryNames(queryName, None).toArray()]
return servers
def get_server_states(servers):
serverstates = {}
for server in servers:
name = adminClient.getAttribute(server, "name")
pid = adminClient.getAttribute(server, "pid")
state = adminClient.getAttribute(server, "state")
serverstates[name] = {'name' : name, 'state' : state, 'pid' : pid}
return serverstates
DMGRs = []
DMGRs.append(DeploymentManager('dmgr1_host', 'dmgr1_soap_port', 'dmgr1_user', 'dmgr1_pw'))
DMGRs.append(DeploymentManager('dmgr2_host', 'dmgr2_soap_port', 'dmgr2_user', 'dmgr2_pw'))
DMGRs.append(DeploymentManager('dmgr3_host', 'dmgr3_soap_port', 'dmgr3_user', 'dmgr3_pw'))
for DMGR in DMGRs:
adminClient = create_admin_client(DMGR.host, DMGR.soapport, DMGR.user, DMGR.password)
queryName = ObjectName("WebSphere:*,node=*,type=Server,name=srv*")
servers = get_servers()
serverstates = get_server_states(servers)
print '## %s ##' % DMGR.host
keys = serverstates.keys()
keys.sort()
for key in keys:
print '%s %s: %s' % (serverstates[key]['name'],
serverstates[key]['pid'],
serverstates[key]['state'])
print
Here's the error I see when I run it:
jython -Dpython.path=/opt/IBM/WebSphere/AppServer/runtimes/com.ibm.ws.admin.client_7.0.0.jar:/opt/IBM/WebSphere/AppServer/plugins/com.ibm.ws.security.crypto.jar:/opt/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar -Dcom.ibm.SOAP.ConfigURL=/opt/IBM/Profiles/dmgr01/properties/soap.client.props was_common.py
Apr 16, 2012 3:07:39 PM com.ibm.ws.management.connector.interop.JMXClassLoader
WARNING: Could not find tmx4jTransform.jar in null/etc/tmx4jTransform.jar - Interoperability to older versions of WebSphere is disabled
Apr 16, 2012 3:07:40 PM com.ibm.ws.ssl.config.SSLConfigManager
INFO: ssl.disable.url.hostname.verification.CWPKI0027I
Apr 16, 2012 3:07:40 PM com.ibm.ws.security.config.SecurityObjectLocator
INFO: Client code attempting to load security configuration
Traceback (most recent call last):
File "was_common.py", line 56, in <module>
adminClient = create_admin_client(DMGR.host, DMGR.soapport, DMGR.user, DMGR.password)
File "was_common.py", line 30, in create_admin_client
adminClient = AdminClientFactory.createAdminClient(props)
at com.ibm.websphere.management.AdminClientFactory.createAdminClientPrivileged(AdminClientFactory.java:632)
at com.ibm.websphere.management.AdminClientFactory.access$000(AdminClientFactory.java:123)
at com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFactory.java:206)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
com.ibm.websphere.management.exception.ConnectorException: com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: The system cannot create a SOAP connector to connect to host dmgr1_host at port dmgr1_soap_port
Note: I changed some values in this example to generic values.