~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/service/windows/service.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
var (
21
21
        logger   = loggo.GetLogger("juju.worker.deployer.service")
22
22
        renderer = &shell.PowershellRenderer{}
 
23
)
23
24
 
 
25
const (
24
26
        // c_ERROR_SERVICE_DOES_NOT_EXIST is returned by the OS when trying to open
25
27
        // an inexistent service
26
28
        // https://msdn.microsoft.com/en-us/library/windows/desktop/ms684330%28v=vs.85%29.aspx
30
32
        // we are trying to create, already exists
31
33
        c_ERROR_SERVICE_EXISTS syscall.Errno = 0x431
32
34
 
33
 
        // c_ERROR_ACCESS_DENIED is returned by the operating system if access is denied
34
 
        // to that service.
35
 
        c_ERROR_ACCESS_DENIED syscall.Errno = 0x5
36
 
 
37
35
        // This is the user under which juju services start. We chose to use a
38
36
        // normal user for this purpose because some installers require a normal
39
37
        // user with a proper user profile to actually run. This user is created
218
216
                return errors.Trace(err)
219
217
        }
220
218
        if installed {
221
 
                return errors.Errorf("Service %s already installed", s.Service.Name)
 
219
                return errors.Errorf("Service %s already installed", s.Name())
222
220
        }
223
221
 
224
222
        logger.Infof("Installing Service %v", s.Name())