I have a service under Linux using a configuration file with a couple of database file paths. The service starts fine.

In order to use the same installation procedure we have for Windows servers, I am trying to define the service with all (or most) of the required parameters placed in config files, for Linux.

The ideal solution is to have a statement defined as below that is creating errors:

./dbsvc @/home/test/srvparms.txt

where srvparms.txt would contain:

-as 
-s Automatic 
-t Network 
-w SERVTEST 
-n LNX 
-c 16m 
-o "/home/Database/Logs/release.txt" 
-oe "/home/Database/Logs/rel_errolog.txt" 
-os 1M 
-x tcpip
/home/Database/aaa.db -n AAA
/home/Database/bbb.db -n BBB

I also tried using two configuration files to have the database file paths separated from the service parameters that didn't seem to help.

./dbsvc @/home/test/srvparms.txt  @/home/test/dbpath.txt

where srvparms.txt would contain:

-as 
-s Automatic 
-t Network 
-w SERVTEST 
-n LNX 
-c 16m 
-o "/home/Database/Logs/release.txt" 
-oe "/home/Database/Logs/rel_errolog.txt" 
-os 1M 
-x tcpip

and the dbpath.txt file would contain only:

/home/Database/aaa.db -n AAA
/home/Database/bbb.db -n BBB

I checked the documentation and found the text below but, I am not sure if the configuration file for all parameters is only valid on Windows environment as the only example I found is for Windows.

"The @data parameter can occur at any point in the command line, and parameters contained in the file are inserted at that point. You can use @data multiple times on one command line to specify multiple configuration files."

For Linux, can a service be defined when all parameters are setup in configuration file(s)?

asked 18 Sep '12, 18:12

Derli%20Marcochi's gravatar image

Derli Marcochi
1.6k323877
accept rate: 33%

edited 18 Sep '12, 18:14


dbsvc on unix is actually a shell script. It does not appear to support the use of @data configuration files.

permanent link

answered 18 Sep '12, 23:25

Graeme%20Perrow's gravatar image

Graeme Perrow
8.5k371109
accept rate: 52%

1

The documentation doesn't provide enough details about the @data usage for dbsvc on Linux. However , in the link below it is suggested for "special" situations.

http://dcx.sybase.com/index.html#1201/en/dbadmin/dbsvc-service-dbutilities-linux.html

(19 Sep '12, 05:52) Derli Marcochi

The current behavior is that @data can be used to pass the arguments to the binary being installed as a service, but @data can not be used to encapsulate arguments to dbsvc itself on Linux.

When writing a service, the command-line format is:

dbsvc [creation options] -w <svc> <Details>

Above, <details> can use @data. It will pass the dbsvc parsing, and the binary being installed as a service will receive the @data arguments.

So, you can get closer, but not all the way there. Example:

dbsvc -y -s auto -as -t Network -w SERVTEST @/home/test/dbpath.txt

Hope this helps.

permanent link

answered 07 Nov '12, 11:51

Dan%20Cummins's gravatar image

Dan Cummins
501613
accept rate: 41%

1

We need to have the ability to apply scripts from InstallShield projects as we do with dbsrv12 for Windows servers. That's why we need the server name and the communication parameters to also be found as an external file in Linux. The workaround we are using is to manually create a text file with all of the required parameters but since this file is not used when the service starts the contents can be misleading.

(07 Nov '12, 14:38) Derli Marcochi

In the example above is there a way to have -w <svc> included in the dbpath.txt file as well?

(12 Nov '12, 22:20) nico
1

I don't think it is possible to add the -w switch to the @data file (at least from my attempts) however the documentation says that @data can be used for "special" situations.

(02 Dec '12, 09:06) Derli Marcochi
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×61
×2

question asked: 18 Sep '12, 18:12

question was seen: 3,051 times

last updated: 02 Dec '12, 09:06