si.py 文件源码

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

项目:Starfish 作者: BillWang139967 项目源码 文件源码
def autostart_list(self):
        """Return a list of the autostart service name.
        """
        with open('/etc/inittab') as f:
            for line in f:
                if line.startswith('id:'):
                    startlevel = line.split(':')[1]
                    break
        rcpath = '/etc/rc.d/rc%s.d/' % startlevel
        services = [
            os.path.basename(os.readlink(filepath))
            for filepath in glob.glob('%s/S*' % rcpath)]
        return services
#}}}
#{{{Tool
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号