Service restarting method and device

The embodiment of the invention provides a service restarting method and device. The method comprises the steps of: by a service process, acquiring a socket bound with a target interface according to a restart instruction; creating a service subprocess which is the same with the service process, and...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: HAO YANKAI
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The embodiment of the invention provides a service restarting method and device. The method comprises the steps of: by a service process, acquiring a socket bound with a target interface according to a restart instruction; creating a service subprocess which is the same with the service process, and transmitting the bound socket into the service subprocess; after judging that the service process does not has a request, closing the service process; and aiming at data of the target interface, calling the bound socket by adopting the service subprocess. Hot restart on a service is implemented; the service can be restarted in a case of not interrupting the service; the service restarting method and device are simple to operate, do not need to use a backup server, and are convenient and rapid to carry out service upgrading. 本发明实施例提供了种服务的重启方法和装置,所述的方法包括:服务进程依据重启指令,获取与目标接口绑定的套接字socket;创建与所述服务进程相同的服务子进程,对所述服务子进程传入所述绑定的socket;判断所述服务进程不存在请求后,关闭所述服务进程;针对所述目标接口的数据,采用所述服务子进程调用所述绑定的socket。实现对服务的热重启,能够在不中断服务的情况下重启服务,操作简单,无需