ntpmon.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ntpmon 作者: paulgear 项目源码 文件源码
def install_ntpmon():
    """
    Install package dependencies, source files, and startup configuration.
    """
    hookenv.log('installing ntpmon dependencies')
    apt_install(['python3-psutil'])

    hookenv.log('installing ntpmon')
    host.rsync('src/', ntpmon_dir)

    if host.init_is_systemd():
        hookenv.log('installing ntpmon systemd configuration')
        host.rsync('src/' + service_name + '.systemd', systemd_config)
        subprocess.call(['systemd', 'daemon-reload'])
    else:
        hookenv.log('installing ntpmon upstart configuration')
        host.rsync('src/' + service_name + '.upstart', upstart_config)
    set_state('ntpmon.installed')
    remove_state('ntpmon.configured')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号