Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to ensure SQL Service ,sqlagent service is running #960

Closed
rsganta opened this issue Dec 22, 2017 · 1 comment · Fixed by #962
Closed

How to ensure SQL Service ,sqlagent service is running #960

rsganta opened this issue Dec 22, 2017 · 1 comment · Fixed by #962
Assignees
Labels
enhancement The issue is an enhancement request.

Comments

@rsganta
Copy link

rsganta commented Dec 22, 2017

I have a config that ensures two services (Databaseengine and SQLServerAgent) are running under the given service account. However, noticed couple of observations

  1. Validation of SQLServerAgent always fails . I learnt that there is a known bug . Do you know when this will be fixed. Are there any alternative resource to validate SQLServerAgent service?

  2. Sporadically, I have noticed these two services are not running though they were set to Automatiic . I am under impression restartservice = $true would restart the service if it is stopped. If not , can you please redirect me to the resource which would help to restart the service if it is not running.

I have used the reference link https://github.com/PowerShell/SqlServerDsc/blob/dev/Examples/Resources/SqlServiceAccount/1-ConfigureServiceAccount-UserAccount.ps1

My config:

# region sql services 
        SqlServiceAccount SetServiceAcccount_SQLService 
        { 
             ServerName     =  $Node.NodeName 
             InstanceName   = 'MSSQLSERVER' 
             ServiceType    = 'DatabaseEngine' 
             ServiceAccount = $SqlSysAdmincreds 
             RestartService = $true 
         } 

        SqlServiceAccount SetServiceAcccount_SQLAgent 
        { 
             ServerName     = $Node.NodeName 
             InstanceName   = 'MSSQLSERVER' 
             ServiceType    = 'SQLServerAgent' 
             ServiceAccount = $SqlSysAdmincreds 
             RestartService = $true 
         } 
     # end region sql services
@johlju johlju added the question The issue is a question. label Dec 23, 2017
@johlju
Copy link
Member

johlju commented Dec 23, 2017

  1. @nabrond recently got a PR merged that fixed bugs. Please test the dev-version if that solves your problem. If not, please open a new issue with the problem you are seeing.
  2. RestartService does only restart the service if a change was needed. It does not monitor if the service is running. The parameter description is a bit confusing here, I will get that fixed. Currently only the Service resource make sure a service is always started.

@johlju johlju added enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone. and removed question The issue is a question. labels Dec 23, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Dec 23, 2017
- Made the description of parameter RestartService more descriptive (issue dsccommunity#960).
johlju added a commit that referenced this issue Dec 24, 2017
- Changes to SqlServiceAccount
  - Made the description of parameter RestartService more descriptive (issue #960).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants