def install_user_service(service_file, socket_file):
"""
Installs the service file and socket file into the xinetd
service directory, sets the service to start on boot, and
starts the service now.
Args:
service_file: The path to the systemd service file to install
socket_file: The path to the systemd socket file to install
"""
if service_file is None:
return
service_name = os.path.basename(service_file)
logger.debug("...Installing user service '%s'.", service_name)
# copy service file
service_path = os.path.join(XINETD_SERVICE_PATH, service_name)
shutil.copy2(service_file, service_path)
execute(["service", "xinetd", "restart"], timeout=60)
评论列表
文章目录