Qual è la differenza tra l'avvio di un servizio e l'avvio di un servizio in un dominio?

1

Su macOS (Darwin, derivato di 4.4BSD), hai questo nifty process manager chiamato launchd controllato da launchctl analogico a systemd e systemctl.

L'esecuzione di launchctl da sola produce un elenco di sottocomandi. Tra questi ci sono il bootstrap e il caricamento. Qual è (sono) la differenza (s) tra di loro?

Subcommands:
    bootstrap       Bootstraps a domain or a service into a domain.
    bootout         Tears down a domain or removes a service from a domain.
    enable          Enables an existing service.
    disable         Disables an existing service.
    uncache         Removes the specified service name from the service cache.
    kickstart       Forces an existing service to start.
    attach          Attach the system's debugger to a service.
    debug           Configures the next invocation of a service for debugging.
    kill            Sends a signal to the service instance.
    blame           Prints the reason a service is running.
    print           Prints a description of a domain or service.
    print-cache     Prints information about the service cache.
    print-disabled  Prints which services are disabled.
    plist           Prints a property list embedded in a binary (targets the Info.plist by default).
    procinfo        Prints port information about a process.
    hostinfo        Prints port information about the host.
    resolveport     Resolves a port name from a process to an endpoint in launchd.
    limit           Reads or modifies launchd's resource limits.
    runstats        Prints performance statistics for a service.
    examine         Runs the specified analysis tool against launchd in a non-reentrant manner.
    config          Modifies persistent configuration parameters for launchd domains.
    dumpstate       Dumps launchd state to stdout.
    dumpjpcategory  Dumps the jetsam properties category for all services.
    reboot          Initiates a system reboot of the specified type.
    bootshell       Brings the system up from single-user mode with a console shell.
    load            Bootstraps a service or directory of services.
    unload          Unloads a service or directory of services.
    remove          Unloads the specified service name.
    list            Lists information about services.
    start           Starts the specified service.
    stop            Stops the specified service if it is running.
    setenv          Sets the specified environment variables for all services within the domain.
    unsetenv        Unsets the specified environment variables for all services within the domain.
    getenv          Gets the value of an environment variable from within launchd.
    bsexec          Execute a program in another process' bootstrap context.
    asuser          Execute a program in the bootstrap context of a given user.
    submit          Submit a basic job from the command line.
    managerpid      Prints the PID of the launchd controlling the session.
    manageruid      Prints the UID of the current launchd session.
    managername     Prints the name of the current launchd session.
    error           Prints a description of an error.
    variant         Prints the launchd variant.
    version         Prints the launchd version.
    help            Prints the usage for a given subcommand.
    
posta Jonathan Komar 03.04.2017 - 20:53
fonte

1 risposta

2

Apple ha riscritto launchd in OS X Yosemite (10.10)

Per quanto ho capito, hanno aggiunto bootstrap | bootout come sostituti di load | unload . load | unload sono attualmente elencati sotto LEGACY SUBCOMMANDS nel manuale launchctl.

La principale differenza quando stai provando a caricare o scaricare un agente / demone è che bootstrap | bootout ti obbliga ad essere esplicito riguardo al target domain in cui verrà caricato l'agente / demone.

Dai un'occhiata a questo fantastico post sul blog su alcuni dei le modifiche alla sintassi launchctl in OS X Yosemite launchd rewrite per ulteriori dettagli su tutto ciò che ho appena toccato.

    
risposta data 28.10.2018 - 01:01
fonte

Leggi altre domande sui tag