Opened 11 years ago

Closed 10 years ago

#42487 closed enhancement (duplicate)

port reload or restart command

Reported by: xeron (Ivan Larionov) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.2.99
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), eborisch (Eric A. Borisch), cooljeanius (Eric Gallager), raimue (Rainer Müller)
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Please implement port reload (or port restart) command, which will do something similar to:

port unload && port load

optional: without disabling/enabling OSX launchd autostart.

Attachments (1)

port_reload.patch (6.1 KB) - added by xeron (Ivan Larionov) 11 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

At the moment, port load and port unload simply directly call launchctl. To my knowledge, there is no launchctl equivalent for a restart or reload command. Perhaps we should check if there is any literature on the best method to restart a launchd-controlled service.

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Cc Me!

comment:3 Changed 11 years ago by xeron (Ivan Larionov)

I've implemented it in simple copy&paste way.

Actually I believe load/unload/reload commands could use common codebase because it's really copypasted here, but I don't know tcl enough to optimize it.

comment:4 Changed 11 years ago by jmroot (Joshua Root)

launchctl stop is basically a restart for any job with KeepAlive set, as it will be immediately started again.

comment:5 Changed 11 years ago by xeron (Ivan Larionov)

man launchctl says about stop that "Use of this subcommand is discouraged".

Changed 11 years ago by xeron (Ivan Larionov)

Attachment: port_reload.patch added

comment:6 Changed 11 years ago by eborisch (Eric A. Borisch)

Cc: eborisch@… added

Cc Me!

comment:7 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:8 Changed 11 years ago by raimue (Rainer Müller)

Cc: raimue@… added

Cc Me!

comment:9 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: duplicate
Status: newclosed

Duplicate of #36054.

Note: See TracTickets for help on using tickets.