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.
So here's what happened:
I took the computer to the AppleStore, seeing it was only about three weeks old, and got them to take a look at it. Since it's a company computer I had some company benefits granting me a temporary replacement while they were fixing mine. I took my TimeMachine copy and restored it on to the borrowed Mac. I was surprised to find that the issue still appeared, which was quite annoying. So I restored the Mac again, messed around with the pmset
settings and tried to reproduce the issue but it was impossible.
I then remembered that the issue started appearing a few days ago when I did a battery calibration (Drained the Mac completely) so I restored to a TimeMachine backup from before that and Boom, the issue was gone. At about the same time they called from the store and said that they couldn't reproduce the issue, so I told them what I had found, came in and got my computer back.
All in all, a really weird story but apparently something related to draining the battery while the computer was still on got corrupted and was then included in the TimeMachine backup.
Best Answer
All processes get paused when the system goes to sleep, independent of whether the process is part of macOS, an application or some code you wrote on your own. After the system wakes up again, all processes will continue to run.
PS: Processes which were waiting for network or disk data when going to sleep may run into timeouts though. But that can happen anyway so most processes should be able to handle that anyway.