카테고리 없음

Windows Service Configuration File

nesubriemusmelio 2021. 5. 19. 04:05

In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system settings.

Some applications provide tools to create, modify, and verify the syntax of their configuration files; these sometimes have graphical interfaces. For other programs, system administrators may be expected to create and modify files by hand using a text editor; possible because many are human-editable plain text files. For server processes and operating-system settings, there is often no standard tool, but operating systems may provide their own graphical interfaces such as YaST or debconf.

The default locations for Orchid’s configuration files in Windows are: Orchid’s Default Settings: C:Program FilesOrchidbinorchidserver.properties. Stores all of Orchid's default settings and can be used to update Orchid's port number, manually update the admin password, etc. You can do what you proposed earlier: make the path configurable and then assign a path to it in the Windows Service's application file. It doesn't really matter where the file is located, as long as it can be accessed by the service. Configuring the properties of a Windows Service using command prompt and scripting it in a batch file is really simple and can save you from performing the same manual configuration again and again. The sc utility comes handy to achieve this. In the example below, we are going to configure a windows service to: Set. Allows users to specify a shell or terminal command as the external source for configuration file options or the full configuration file. If the configuration file includes the exec expansion, on Linux/macOS, the write access to the configuration file must be limited to the user running the mongod / mongos process only. If you are using a App.Config file within a windows service to store the configuration setting for your windows service, do you have to recompile the windows service in order to get the new settings to be in effect in the windows service if you make changes to the app.config file. Configuration files and operating systems Unix and Unix-like operating systems. Across Unix-like operating systems many different configuration-file formats exist, with each application or service potentially having a unique format, but there is a strong tradition of them being in human-editable plain text, and a simple key-value pair format is common. Black Viper’s Windows 10 Service Configurations. Surface and Surface Pro Windows 10 Users: The Tweaked configuration assumes a desktop. Network File System.

Some computer programs only read their configuration files at startup. Others periodically check the configuration files for changes. Users can instruct some programs to re-read the configuration files and apply the changes to the current process, or indeed to read arbitrary files as a configuration file. There are no definitive standards or strong conventions.

A configuration file for GNU GRUB being edited. Comments (the lines beginning with a '#') are used both as documentation and as a way to 'disable' the setting.
  • 1Configuration files and operating systems

Configuration files and operating systems[edit]

Unix and Unix-like operating systems[edit]

Across Unix-like operating systems many different configuration-file formats exist, with each application or service potentially having a unique format, but there is a strong tradition of them being in human-editable plain text, and a simple key-value pair format is common. Filename extensions of .cnf, .conf, .cfg, .cf or as well .ini and similar are often used.

Almost all formats allow comments, in which case, individual settings can be disabled by prepending with the comment character. Often the default configuration files contain extensive internal documentation in the form of comments[1][2] and man files are also typically used to document the format and options available.

System-wide software often uses configuration files stored in /etc, while user applications often use a 'dotfile' – a file or directory in the home directory prefixed with a period, which in Unix hides the file or directory from casual listing.

Some configuration files run a set of commands upon startup. A common convention is for such files to have 'rc' in their name,[3] typically using the name of the program then an '(.)rc' suffix e.g. '.xinitrc', '.vimrc', '.bashrc', 'xsane.rc'. See run commands for further details.

By contrast, IBM's AIX uses an Object Data Manager (ODM) database to store much of its system settings.

MS-DOS[edit]

MS-DOS itself primarily relied on just one configuration file, CONFIG.SYS. This was a plain text file with simple key-value pairs (e.g. DEVICEHIGH=C:DOSANSI.SYS) until MS-DOS 6, which introduced an INI-file style format. There was also a standard plain text batch file named AUTOEXEC.BAT that ran a series of commands on boot. Both these files were retained up to Windows 98SE, which still ran on top of MS-DOS.

An example CONFIG.SYS for MS-DOS 5:

DOS applications used a wide variety of individual configuration files, most of them binary, proprietary and undocumented - and there were no common conventions or formats.[citation needed]

Microsoft Windows[edit]

C# Windows Service Config File

The REGEDIT application being used to edit Windows Registry data

The early Microsoft Windows family of operating systems heavily utilized plain-text INI files (from 'initialization'). These served as the primary mechanism to configure the operating system and application features.[4] The APIs to read and write from these still exist in Windows, but after 1993, Microsoft began to steer developers away from using INI files and toward storing settings in the Windows Registry, a hierarchical database to store configuration settings, which was introduced that year with Windows NT.

Mac OS X[edit]

The property list file is the standard configuration file format in Mac OS X (as well as in iOS, NeXTSTEP, GNUstep and Cocoa applications). Property list files use the filename extension .plist, and thus are often referred to as p-list files.

IBM OS/2[edit]

IBM's OS/2 uses a binary format, also with a .INI suffix, but this differs from the Windows versions.It contains a list of lists of untyped key-value pairs.[5]Two files control system-wide settings: OS2.INI and OS2SYS.INI.Application developers can choose whether to use them or to create a specific file for their applications.

Serialization formats[edit]

A number of general-purpose serialization formats exist that can represent complex data structures in an easily stored format, and these are often used as a basis for configuration files, particularly in open-source and platform-neutral software applications and libraries. The specifications describing these formats are routinely made available to the public, thus increasing the availability of parsers and emitters across programming languages.

Examples include: XML, TOML, YAML and JSON.

See also[edit]

  • INI file, a common configuration file format
  • .properties, a file extension mainly used in Java
  • JSON, with support for complex data types and data structures
  • HOCON, a superset of .properties and JSON
  • Run commands, which explains the historical origin of the 'rc' suffix
  • TOML, a formally-specified configuration file format
  • YAML, with support for complex data types and structures

References[edit]

  1. ^https://opensource.apple.com/source/postfix/postfix-174.2/Postfix.Config/main.cf.default.
  2. ^http://opensource.apple.com/source/apache/apache-769/httpd.conf.
  3. ^'rc file'. Catb.org. Retrieved 2012-02-29.
  4. ^Microsoft: Windows NT Workstation Resource Kit.
  5. ^The OS/2 INI Files by James J. Weinkam.
Redis windows service config file

External links[edit]

  • libprf1 - alpha cross-platform, multi-language support for accessing the Preferences Registry Format (PRF) 1.0 configuration files
  • Config - configuration file management. Supports INI, .properties, JSON, XML, TOML, and YAML.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Configuration_file&oldid=914892789'

Re: How to set a configuration file for a windows service application ?

Nov 06, 2010 05:47 AM|Imar_Spaanjaars|LINK

Hi there,

Eventually, the class library is consumed / used by the service, so you need to add the keys to the config file of the Windows service project. (It's not uncommon to add an app.config to the library as well so others can see what keys are assumed to be there. Then when you deploy, you copy the required keys from app.config of the library to the app.config of the Windows service where they can be accessed at run-time.)

To manage the keys, you add them to the appSettings element, like this:

<add key='sourcePath' value='F:forms' />

To access those values through code (in the class library) you use something like:

string sourcePath= ConfigurationManager.AppSettings.Get('sourcePath');

This code is placed in the library, but at run-time gets its values from app.config of the Windows service.

If you have lots of keys, you may want to consider using a dictionary adapter: http://imar.spaanjaars.com/550/making-application-configuration-easier-using-the-castle-dictionaryadapter

Cheers,

Windows File Service Configuration 2008

Imar