dbTalk Databases Forums  

Changing server switches when a service is started rather than when it is created/modified

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Changing server switches when a service is started rather than when it is created/modified in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger Holmes
 
Posts: n/a

Default Changing server switches when a service is started rather than when it is created/modified - 10-28-2009 , 05:19 AM






Hi,

I use the following to create a service:

dbsvc @dbsvc.ini

where dbsvc.ini contains:

### Network or Standalone
-t Network
### Automatic or Manual Start
-s Automatic
### Account name
-a domain\useraccount
### Account password
-p password
### Display Name
-sn "Application Name"
### Description
-sd "Application Description"
### No confirmations
-y
### Service Name
-w "Servname"
### Locaion of Server Executable
"D:\Program Files\application\dbsrv10.exe"
### Server Start Line Configuration file
"@D:\DB\SwitchFile.Txt"

This works, but it seems SwitchFile.txt is expanded when the service is
created.

Is it possible to tell the service to use the contents of SwitchFile.Txt
when the service is started?

Thanks,
Roger

SQLAnywhere 10.0.1.3960 (W2003SP2Std)

Reply With Quote
  #2  
Old   
Graeme Perrow [Sybase iAnywhere]
 
Posts: n/a

Default Re: Changing server switches when a service is started rather thanwhen it is created/modified - 10-28-2009 , 08:44 AM






If you specify the @file on the command line, this will work as you
expect. Remove @D:\DB\SwitchFile.Txt from the dbsvc.ini file and execute:

dbsvc @dbsvc.ini @D:\DB\SwitchFile.Txt

This happens because @files can be nested, so one file can load another.
dbsvc parses its command line parameters a little differently than other
tools, so that @files specified before the service executable are read
in (eg. dbsvc.ini) but those specified after the service executable are
left as-is. The code to read from @files is shared among all the tools
(and the server, and MobiLink, etc.) so it doesn't know about this
little parsing quirk in dbsvc.

Graeme Perrow
Senior Software Developer
gperrow _at_ ianywhere _dot_ com
Sybase iAnywhere Engineering

SQL Anywhere Developer Community
http://www.sybase.com/developer/libr...ere-techcorner
SQL Anywhere Blog Center
http://www.sybase.com/sqlanyblogs


Roger Holmes wrote:
Quote:
Hi,

I use the following to create a service:

dbsvc @dbsvc.ini

where dbsvc.ini contains:

### Network or Standalone
-t Network
### Automatic or Manual Start
-s Automatic
### Account name
-a domain\useraccount
### Account password
-p password
### Display Name
-sn "Application Name"
### Description
-sd "Application Description"
### No confirmations
-y
### Service Name
-w "Servname"
### Locaion of Server Executable
"D:\Program Files\application\dbsrv10.exe"
### Server Start Line Configuration file
"@D:\DB\SwitchFile.Txt"

This works, but it seems SwitchFile.txt is expanded when the service is
created.

Is it possible to tell the service to use the contents of SwitchFile.Txt
when the service is started?

Thanks,
Roger

SQLAnywhere 10.0.1.3960 (W2003SP2Std)


Reply With Quote
  #3  
Old   
Roger Holmes
 
Posts: n/a

Default Re: Changing server switches when a service is started rather than when it is created/modified - 10-28-2009 , 09:20 AM



Many thanks Graeme - that works perfectly.

Quote:
so it doesn't know about this little parsing quirk in dbsvc.
It may be a quirk now but it need to be defined as a feature. That's a very
useful trick.

Cheers,
Roger

"Graeme Perrow [Sybase iAnywhere]"
<ReplyToNewsgroupOnly-gperrowNO (AT) SPAMianywhere (DOT) PLEASEcom> wrote

Quote:
If you specify the @file on the command line, this will work as you
expect. Remove @D:\DB\SwitchFile.Txt from the dbsvc.ini file and execute:

dbsvc @dbsvc.ini @D:\DB\SwitchFile.Txt

This happens because @files can be nested, so one file can load another.
dbsvc parses its command line parameters a little differently than other
tools, so that @files specified before the service executable are read in
(eg. dbsvc.ini) but those specified after the service executable are left
as-is. The code to read from @files is shared among all the tools (and the
server, and MobiLink, etc.) so it doesn't know about this little parsing
quirk in dbsvc.

Graeme Perrow
Senior Software Developer
gperrow _at_ ianywhere _dot_ com
Sybase iAnywhere Engineering

SQL Anywhere Developer Community
http://www.sybase.com/developer/libr...ere-techcorner
SQL Anywhere Blog Center
http://www.sybase.com/sqlanyblogs


Roger Holmes wrote:
Hi,

I use the following to create a service:

dbsvc @dbsvc.ini

where dbsvc.ini contains:

### Network or Standalone
-t Network
### Automatic or Manual Start
-s Automatic
### Account name
-a domain\useraccount
### Account password
-p password
### Display Name
-sn "Application Name"
### Description
-sd "Application Description"
### No confirmations
-y
### Service Name
-w "Servname"
### Locaion of Server Executable
"D:\Program Files\application\dbsrv10.exe"
### Server Start Line Configuration file
"@D:\DB\SwitchFile.Txt"

This works, but it seems SwitchFile.txt is expanded when the service is
created.

Is it possible to tell the service to use the contents of SwitchFile.Txt
when the service is started?

Thanks,
Roger

SQLAnywhere 10.0.1.3960 (W2003SP2Std)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.