Simple usage of Mac using LAUNCHD command line LAUCHCTL operation service

Source: Internet
Author: User

Note: The operation of the front, such as with sudo, or only the current user's services, there will be unable to operate some root users of the service problem. The system version is Mac 10.12.

1. After plist configuration:

#/system/library/launchdaemons/ssh.  # Uninstall a service sudo launchctl unload  

2. View all services:

sudo launchctl list

3. View service Status

sudo launchctl list | grep <<service name>>

The output has the following meanings:

    • The first number is the PID of the process, if it is running, if it does not run, it shows a '-'.
    • The second number is the exit code for the process if it has already been completed. If it is negative, it is the number that kills the signal.
    • The third column is the process name.

4. Service operation

#<<service name>>#start <<service name>>#<< Service name>>

5, more usage Direct input: Launchctl Help for viewing.

Reference:

Https://stackoverflow.com/questions/36594650/command-to-get-the-service-status-of-mac-os

Https://serverfault.com/questions/194832/how-to-start-stop-restart-launchd-services-from-the-command-line

Simple usage of Mac using LAUNCHD command line LAUCHCTL operation service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.