cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration file under Linux

5,327

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)?

Accepted Solutions (1)

Accepted Solutions (1)

graeme_perrow
Advisor
Advisor
0 Kudos

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

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

Answers (1)

Answers (1)

Dan_Cummins
Advisor
Advisor

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.

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.

Former Member
0 Kudos

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

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.