It is strange to see the questions between "windows migrated" and "default mac" users. :) Windows migrated users usually want "somewhat tweak" the system. Default Mac users - simply "using it".
I'm using MAC much years, and never needed to use the launchctl command. If mean never, mean in normal usage, of course sometimes needed use it when installing somethings from the macports - for onetime load of startup files or so.
I'm wondering, why you need start/stop/restart services with launchctl? Asking because if you not an experienced OS X users you probably will screw the system "harmony" :). So, in this case - IMHO - better to ask the specific problem, so ask how to start/stop the specific service.
As the answer - check first System preferences. Most common services are in the "Sharing" pane" - like web-server, sshd, CD sharing and so on...
Some third party dmg files with GNU stuff comes with own preference pane too. For example, you can install precompiled MYSQL server with a preference pane, what allow you start-restart the server.
If you don't find the wanted service in prefs, be more precise. What service you need start/stop? The "launchctl" command works as needed to work, ActivityMonitor too. You ofc can use "ps axuwww" or "top" commands from the Terminal too.
Remember, your now in the UNIX world, so nearly anything can be done from the command-line, but usually thats mean really much learning.. ;)
EDIT:
try:
sudo kill -1 204
^-process number
from the terminal, or simply kill the daemon from the ActivityMonitor. The watchdog should restart it.
Have you any lighthttpd file in the /Library/LaunchDaemons/*? So, any output form the command:
ls /Library/LaunchDaemons | grep -i light
if yes, you can use the:
sudo launchctl unload /Library/LaunchDaemons/filename.plist
sudo launchctl load /Library/LaunchDaemons/filename.plist
command for stop/start.
Well, these commands edit .plist files in your /Users/xyz/Library/Preferences folder. So, if you look at these files, you can look at these files and base your Terminal commands after these.
These are XML-based files, so you can view them in a more readable format if you open them in Xcode, which is available in the Mac App Store.
In the Terminal, the format for these is "defaults write PLIST_FILE KEY -TYPE VALUE"
where the PLIST_FILE is the name of the file in the Preferences folder without the .plist, KEY is the key that you can see in Xcode, -TYPE is the type of key that you can find Xcode (and you can find if there is an abbreviation for that type by typing "defaults" into the terminal), and value is the value you wish to set the key at.
Here are some of the string types from the Terminal:
-string <string_value>
-data <hex_digits>
-int[eger] <integer_value>
-float <floating-point_value>
-bool[ean] (true | false | yes | no)
-date <date_rep>
-array <value1> <value2> ...
-array-add <value1> <value2> ...
-dict <key1> <value1> <key2> <value2> ...
-dict-add <key1> <value1> ...
Best Answer
You can use the following command:
From
ps
man page: