One windows service is there, let ‘A’.
The Service A’s application data’s is pointing following path “C:\Documents and Settings\All Users\Application Data\” .
And its installed in following path “C:\Program Files\”.
It is having some config files in Application data’s section (i.e> in the following path “C:\Documents and Settings\All Users\Application Data\”)
I created a new service with the reference of service A.
I installed my service in “C:\Program Files\”.
When I run my service its getting some exception like,
Could not find a part of the path 'C:\Documents and Settings\LocalService\Application Data\A\A.dll.config'.
Ie> Service ‘A‘ dll is referring some config file in 'C:\Documents and Settings\LocalService\Application Data…’ path, instead of referring “C:\Documents and Settings\All Users\Application Data\” path.
And my own serviceApplication.Userdata path is pointing 'C:\Documents and Settings\LocalService\Application Data..’ path.
how to resolve the path mapping plbm in windows services using C#?
Sounds like the second service is not retreiving the path to service A's config file the right way. Can you provide more details about that?
Related
I have a Grails application that I run as a Linux service. Basically I create a symlink from /etc/init.d/mygrailsservice to mygrailsservice.jar.
I want to increase the amount of OS memory allocated to the service.
How do I configure this?
Have a look at the spring-boot docs for executable jars and using them as system services - https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
Specifically https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-script-customization-when-it-runs
With the exception of JARFILE and APP_NAME, the above settings can be
configured using a .conf file. The file is expected next to the jar
file and have the same name but suffixed with .conf rather than .jar.
For example, a jar named /var/myapp/myapp.jar will use the
configuration file named /var/myapp/myapp.conf.
myapp.conf.
JAVA_OPTS=-Xmx1024M
LOG_FOLDER=/custom/log/folder
am getting below issue while connecting the TDS with VS 2015.
Creating directory
"\10.207.7.199\c$\inetpub\wwwroot\DEVCMS\Website_DEV". C:\Program
Files
(x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets(560,5):
Error MSB3021: Unable to copy file "C:\Program Files
(x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\TdsService.asmx"
to
"\10.207.7.199\c$\inetpub\wwwroot\DEVCMS\Website_DEV\TdsService.asmx".
Access to the path
'\10.207.7.199\c$\inetpub\wwwroot\DEVCMS\Website_DEV' is denied.
Also am able to access the \\10.207.7.199\c$\inetpub\wwwroot\DEVCMS\Website\_DEV path from build server.
This looks like you are attempting to deploy with TDS to a target website and you do not have permission to do so. Try running Visual Studio in 'administrator mode' to see if this resolves the permission issue.
Also, validate that the path you are attempting to deploy to is correct. It does not look valid, as I would have expected it to have a double slash at the beginning for a network path and then a slash at the end before _DEV.
Also, you appear to be accessing the C$ drive on a networked server. Typically you must be the administrator on that system in order for this to function correctly. I would recommend instead setting up a UNC Share folder that you will allow to write to a particular folder (maybe the Website folder) for any requests from your deployment system.
I know that can add set of docroot in yaws.conf but this not always convenient. Is exist way to start of server from current directory with yaws without modifying configuration file?
Two options:
Keep a template of your yaws.conf file somewhere and invoke yaws through a script that first uses the template to create a conf file with the current working directory filled in as docroot, and then runs yaws using its --conf command-line option to specify the newly-created conf file as its configuration file.
Run yaws in embedded mode, which allows you to programmatically specify the configuration. You can use file:get_cwd/0 to obtain the pathname of the current working directory, then use it as the value for docroot in the configuration details you pass to yaws_api:embedded_start_conf/1,2,3,4.
I'm trying to reference FakeLib.dll from my local Fake.Deploy installation in my deployment script but can't seem to find the correct path to use. I found that Environment.CurrentDirectory points to my Fake.Deploy installation, but just using
#r #"FakeLib.dll"
doesn't work:
Deploy messages
{
2015-05-12 09::22:50.413
2015-05-12 09::22:50.417
2015-05-12 09::22:50.417 Install.fsx(2,1): error FS0082: Could not resolve this reference. Could not locate the assembly "FakeLib.dll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)
2015-05-12 09::22:50.432
2015-05-12 09::22:50.432
2015-05-12 09::22:50.433 Install.fsx(2,1): error FS0084: Assembly reference 'FakeLib.dll' was not found or is invalid
}
Examples I found on the web suggest to deploy FAKE along with my application in the NuGet package and reference it like this:
#r #"tools\FAKE\tools\FakeLib.dll"
but this seems like overkill and an unnecessary reference.
Does anyone know what path to use to reference the local Fake.Deploy installation?
Just found the answer myself: the base directory used for references in the post-deployment fsx script is __SOURCE_DIRECTORY__, the directory of the deployment itself.
So assuming your Fake.Deploy is installed in
.\Fake.Deploy\
then Environment.CurrentDirectory will point to this directory, whereas __SOURCE_DIRECTORY__ will point to
.\Fake.Deploy\deployments\\{your_app}\active
So you can reference FakeLib.dll from your post-deployment fsx script as follows:
#r #"..\..\..\FakeLib.dll"
I will try to get this added to the documentation page.
That being said, there are in fact points to be made for deploying FAKE together with your application:
It makes sure the correct version is used to run your deployment script
The Fake.Deploy installation might not be be under your control, so you could be prevented permission-wise from accessing its binaries
The configuration of Fake.Deploy allows to specify a different deplyoment location (via "WorkDirectory"), so this hardcoded path will break when using a non-default location
Note that when your NuGet package is sent over via Fake.Deploy, the agent runs the script in the root of the package from the same folder as the fake executable. So, when your fake.exe is in C:\Fake\tools\fake.exe, your files are in C:\Fake\tools\deployments\YourApplication\active. If you need to read a properties file or something from that directory, your script won't see it. So, you'll need to do the following in your script:
open System
open System.IO
let arguments = System.Environment.GetCommandLineArgs()
let script = arguments.[1]
let scriptDirectory = script.Replace(#"\NameOfMyDeployScript.fsx", #"")
System.IO.Directory.SetCurrentDirectory(scriptDirectory)
I wanted to put that out there so no one loses their mind over trying to access some file. You'll see an error like this if you don't change directories:
System.IO.FileNotFoundException: Could not find file 'C:\Fake\tools\myfile.properties'
I am attempting to get a Grails project working but need help setting it up. I have an Ubuntu server running on a VM that has Redis installed. The project won't run unless I create a config file that can use Redis on the Ubuntu server. This is the settings I pulled down from GitHub located in the grails-app/conf/Config.groovy file.
http://snag.gy/eYhUY.jpg
I was told I need to create a separate config file that will override these parameters so my project will talk to the ubuntu server on my machine. This is a noob question but where do I create a config file? I can't seem to find a .grails folder. I know I'm suppose to reference my config file, once i've created one, in the grails-app/conf/Config.groovy file
http://snag.gy/SpGGt.jpg
Look at the grails.config.locations specified in your Config.grooy and you can create any of those locations for creating the external Config file.
I prefer using the classpath route. Here is what I would do.
Create a folder (say appConfig) and place it in the tomcat/conf folder.
Add the application config file (proghorn-config.groovy in your case) to the folder, with the required configurations in the file.
Add the folder to the Tomcat classpath by updating either the tomcat/conf/catalina.properties or by creating the tomcat/bin/setenv.sh
The location of the .grails folder depends upon the user account running the container (Tomcat, Jetty, etc.) which hosts your Grails application.
For example on Debian 6 running Tomcat 6.x the location is:
/usr/share/tomcat6/.grails/
You can also use static paths as well:
file:/usr/local/tomcat/conf/myspecific-config.groovy