Jenkins install on AWS ec2 dedicated host

Newbie questiong here:
I was able to install jenkins-lts without many issues on an EC2 instance with macOS

┌───┬──┐   __|  __|_  )
│ ╷╭╯╷ │   _|  (     /
│  └╮  │  ___|\___|___|
│ ╰─┼╯ │  Amazon EC2
└───┴──┘  macOS Monterey 12.4

And I can start jenkins from the shell (after connecting with ssh)

ec2-user@ip-11-22-33-44 ~ % jenkins-lts
Running from: /opt/homebrew/Cellar/jenkins-lts/2.346.1/libexec/jenkins.war
webroot: $user.home/.jenkins
2022-07-25 22:06:49.433+0000 [id=1]     INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @239ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-07-25 22:06:49.470+0000 [id=1]     INFO    winstone.Logger#logInternal: Beginning extraction from war file
...

However when I try to run it as a service, it fails

ec2-user@ip-11-22-33-44 ~ % brew services start jenkins-lts
Could not enable service: 125: Domain does not support specified action
Error: Failure while executing; `/bin/launchctl enable gui/501/homebrew.mxcl.jenkins-lts` exited with 125.

Is there any detailed log file I can inspect?

I do not have a GUI access to this EC2 instance. Is there something I have to pass on to disable gui?

Thanks,

Hello there :wave:

What about using sudo to start the service?

sudo brew services start jenkins-lts

1 Like

Thank you, Yes that worked.

sudo brew services start jenkins-lts
Warning: Taking root:admin ownership of some jenkins-lts paths:
  /opt/homebrew/Cellar/openjdk@11/11.0.16/libexec/openjdk.jdk/Contents/Home/bin
  /opt/homebrew/Cellar/openjdk@11/11.0.16/libexec/openjdk.jdk/Contents/Home/bin/java
  /opt/homebrew/opt/jenkins-lts
  /opt/homebrew/var/homebrew/linked/jenkins-lts
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: jenkins-lts must be run as non-root to start at user login!
==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)

so what about the warning that the service should be started with non-root at user login?

1 Like

Thanks a lot for your feedback.
I do hope someone having worked on the move to systemd will chime in and let us know about this warning.
Basil, maybe?

So macOS Installers for Jenkins LTS says brew is managed externally.

1 Like

Thanks Gavin,

The documentation at macOS Installers for Jenkins Weekly mentioned the native installer being deprecated.

What would you recommend to install jenkins-lts on a mac?

or don’t install the -lts and try the latest version?

I think the project depreciated it because there’s no mac maintainers. We have trouble finding people to work on the windows installers, and we have way more jenkins installs on windows than we do on mac servers.

You can probably just download the jenkins.war file from the download page, and run java -jar jenkins.war and not worry about it too much