I was wondering how one could change Jenkins-lts default port 8080 on Mac using Homebrew Installation. Actually I have 2 folders one on :
/Users/XXXXXX/.jenkins/ In here after execute all the process still runing on Port:8080
/usr/local/Cellar/jenkins/ In here when I executed the process jenkins running on Port:8383 but any jobs work.
I took the example for other Stack Member Ifeego answered Aug 21 '18 at 8:55, This is what I did:
I have installed Jenkins LTS by brew command:
brew install jenkins-lts
So my Jenkins plist file is here:
/usr/local/Cellar/jenkins-lts/2.121.2/homebrew.mxcl.jenkins-lts.plist
You can modify the httpPort value from default 8080 to the other value,and then save the file.
Label
homebrew.mxcl.jenkins-lts
ProgramArguments
/usr/libexec/java_home
-v
1.8
--exec
java
-Dmail.smtp.starttls.enable=true
-jar
/usr/local/opt/jenkins-lts/libexec/jenkins.war
--httpListenAddress=127.0.0.1
--httpPort=8383
RunAtLoad
sudo launchctl unload command will not work for you. You must try these commands to restart your Jenkins and make the port modification works.
After executed the change on jenkins-lts.plist file:
brew services stop jenkins-lts
brew services start jenkins-lts
ifeegoo:~ ifeegoo$ brew services stop jenkins-lts
Stopping `jenkins-lts`... (might take a while)
==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
ifeegoo:~ ifeegoo$ brew services start jenkins-lts
==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
Note:When I open the terminal and run brew services start jenkins-lts jenkins go up using the new Port:8383 in these case they do not run any job, but when I run on the terminal the command: jenkins-lts the application up in the Port:8080 and here I can run all the Jobs without troubles.
I’m trying to figure out why my apache doesn’t start at startup… (I would like for it to).
My OS: OSX Mojave
Impressions I’m under: that I’m running homebrew’s apache
Upon a fresh boot…
If I hit http://localhost in a browser I get
Unable to connect
Firefox can’t establish a connection to the server at localhost.
Fire up terminal…
$brew services list
returns
httpd started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.php.plist
(That first line makes me think httpd is running and I should be able to hit localhost).
$which -a apachectl
returns
/usr/local/bin/apachectl
/usr/sbin/apachectl
then
$apachectl configtest
returns
Syntax OK
then
$sudo apachectl -V
returns (among other things)
-D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"
(Isn’t this brew’s httpd.conf?)
There's a brew command (which I forget) that I already ran that is supposed to run httpd at startup.
Once I run
$sudo apachectl start
everything is jake. So it’s a low-priority question, but one I would like to solve and understand.
I had the same issue with Homebrew NGINX.
Running the brew services command with sudo solved the problem for me.
It appears that the Homebrew web-server packages require sudo to start | stop | restart.
Try running:
sudo brew services start apache2
Note: We love RethinkDB but our current project does not use it so we need to free up resources on our local machine ...
We installed RethinkDB using homebrew:
brew update && brew install rethinkdb
And added the rethinkdb process to our plist as per the instructions in:
http://rethinkdb.com/docs/start-on-startup/
But now we need to shut it down to free-up the 8080 port for another service.
What command do we need to run? (thanks!)
Do this in the terminal
check to see if you started it using brew
$ brew services list
stop rethinkdb:
$ brew services stop rethinkdb
restart:
$ brew services start rethinkdb
Like this, I think, if you used launchctl:
sudo launchctl unload -w /Library/LaunchDaemons/com.rethinkdb.server.plist
I am very new at Mongo. I am running mongod as described here in Mac OS X. I am running two mongod processes from the command line. If I need to stop the mongod processes I just execute kill <pid of mongod>. Is it the recommended way to stop mongod?
It finally succeeded (Ubuntu 15.04) with
//1.find process by name:
$ pgrep mongo
1350
//2.kill mongod-process
$ kill 1350
This is quite late, but I had same problem now, and I found one easy way :
Esan-iMac:~$mongo admin --eval "db.shutdownServer()"
MongoDB shell version: 2.6.4
connecting to: admin
2015-02-19T10:54:22.574+0200 DBClientCursor::init call() failed
server should be down...
It's giving some odd messages, but it works.
And I made alias-command for running it easy.
alias stop-mongo='/opt/mongo/release/bin/mongo admin --eval "db.shutdownServer()"'
This works at least if you start your mongo manually (e.g. with --fork option).
The accepted answer by Esa is correct. Also, regarding whether using kill is recommended - yes, but with flag -2 or no flag, never use -9. As mentioned in docs.
kill -2 `pgrep mongo`
Alias
alias stopmongo='kill -2 `pgrep mongo`'
Windows
use admin
db.shutdownServer()
For systems with auth enabled, users may only issue db.shutdownServer() when authenticated to the admin database or via the localhost interface on systems without authentication enabled.
Linux
mongod --shutdown
you can also use
kill <mongod process ID>
see http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/
For year of 2020:
Mongo should be installed through Brew, rather than the old school style on linux: i.e. tar.gz package download/uncompress/configure/run.
In the brew way, if Mongo is installed by brew tap mongodb/brew and brew install mongodb-community, you could do as follows to stop (and disable) it alike Systemd on Linux.
~ brew services list
Name Status User Plist
mongodb-community started zhengxin /Users/zhengxin/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
~ brew services stop mongodb-community
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
terminal$ kill $(pgrep mongod)
this command can help killing the mongod process. sudo pkill -f mongod
Just encountered an issue with "just killing the mongod" in mac...
The mongod is kept running as a service by "launchctl" in mac systems. "just killing" it will kill that service.
Now to use mongo shell we do mongod again, however for other development purpose like connecting from node we need to make sure to run mongod time and again.
Other alternative is shut down the system and start again.
Better Way :
Start using launchctl to manage such services. Here is an example for that :
What is the correct way to start a mongod service on linux / OS X?
The easiest way is Ctrl + C, which worked for me on a blocking bash shell under El Capitan.
If you have configured autostart, killing the process won't help, new one will start immediately. In order to disable autostart, you have to locate the autostart file first. You can try to find the file using e.g.
find / -name "mongodb.plist" or locate "mongodb.plist"
After the file is found, remove the autostart config using (you can try without sudo first, it's not needed if you have done the installation using Homebrew):
sudo launchctl unload -w <file>
If you want to kill the process anyway and it's not using autostart, remember not to use kill -9 <PID>, it can damage the db. kill -1 <PID> or kill -15 <PID> should be safe options.
https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes/
official guide
remember not to use kill -9
otherwise maybe you need to remove lock file in dbpath
Just installed MariaDB (with homebrew). Everything looks like it's working, but I can't figure out how to have it automatically startup on boot on my Mac. I can't find any Mac-specific docs for this.
The installation output says:
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
I guess I don't know where the right place is.
From brew info mariadb
To have launchd start mariadb now and restart at login:
brew services start mariadb
Or, if you don't want/need a background service you can just run:
mysql.server start
Just run brew services start mariadb on terminal.
With help from Calvin's answer (deleted, I guess?), and this page, these are the steps I used to accomplish this:
cp /usr/local/Cellar/mariadb/5.5.30/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
On next boot, MariaDB was up and running.
If you install MariaDB by Homebrew, you can use this to see how to start your mariadb at login.
brew info mariadb
To have launchd start mariadb at login:
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
Then to load mariadb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
You need to use launchd. See $ man launchd.
Additionally, Nathan wrote a good article on launchd.