Windows service fails to start with custom user until started once with local user

0

All of a sudden my Windows service application after installation does not start. (Some services stop automatically if they have no work to do.)

The service uses a custom user. If I change the logon setting to use the local system account, the service starts fine. Then when I go back and change the login setting to use this custom account (local user -> custom user under user group), the service will start.

Why doesn't it work in the first place?

Gauls

Posted 2010-03-24T15:13:18.807

Reputation: 111

Look in the Windows Exception Log. It could be that you have the username/password for the service wrong and it's failing at login. – None – 2010-03-24T15:18:12.150

when is the service failing? at boot? is it trying to start before some other service it depends on has started? – quack quixote – 2010-03-25T08:17:56.953

Answers

0

Is the user account disabled?
Does the user account have "User must change password at next logon" checked?
Does the user account have rights to run as a service?

ta.speot.is

Posted 2010-03-24T15:13:18.807

Reputation: 13 727

>

  • User is not disabled
  • nope, set to password never expires
  • user is create for running the service so it has all rights,
  • only confusing point is how does the same user and password works fine after running the service once with local user? – Gauls – 2010-07-02T10:04:39.753

    Doesn't give any exceptions in the log, service is failing when trying to start just after installer has finished installing the service or anytime the service is stopped and started again. – Gauls – 2010-07-02T10:05:33.277

    0

    In my case it was caused by user not having "Logon as a service permission" in computer policies, so after restart Windows will fail to start the service.

    For more information, refer to this MSDN question

    Veton

    Posted 2010-03-24T15:13:18.807

    Reputation: 111