Code Monkey home page Code Monkey logo

sonic-host-services's People

Contributors

a-barboza avatar abdosi avatar anamehra avatar arlakshm avatar bluecmd avatar davidpil2002 avatar dgsudharsan avatar fastiuk avatar fengpan-frank avatar ganglyu avatar jleveque avatar judyjoseph avatar junchao-mellanox avatar liuh-80 avatar liushilongbuaa avatar maipbui avatar mlok-nokia avatar prsunny avatar saiarcot895 avatar shlomibitton avatar stepanblyschak avatar sujinmkang avatar suvarnameenakshi avatar vaibhavhd avatar vdahiya12 avatar vivekrnv avatar xumia avatar ycohenvidia avatar yozhao101 avatar zhaohuis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonic-host-services's Issues

[hostcfgd] wrong behavior for disable_feature

In enable_feature:

        for suffix in feature_suffixes:
            cmds.append("sudo systemctl unmask {}.{}".format(feature_name, suffix))
        cmds.append("sudo systemctl enable {}.{}".format(feature_name, feature_suffixes[-1]))
        cmds.append("sudo systemctl start {}.{}".format(feature_name, feature_suffixes[-1]))

While in disable_feature, this iteration looks wrong:

        for suffix in reversed(feature_suffixes):
            cmds.append("sudo systemctl stop {}.{}".format(feature_name, suffix))
            cmds.append("sudo systemctl disable {}.{}".format(feature_name, feature_suffixes[-1]))
            cmds.append("sudo systemctl mask {}.{}".format(feature_name, feature_suffixes[-1]))

My idea is to change to:

        for suffix in reversed(feature_suffixes):
            cmds.append("sudo systemctl stop {}.{}".format(feature_name, suffix))
            cmds.append("sudo systemctl disable {}.{}".format(feature_name, suffix))
            cmds.append("sudo systemctl mask {}.{}".format(feature_name, suffix))

Let's say,
telemetry has feature_suffixes = ['service', 'timer']

enable_feature:

sudo systemctl unmask t.service
sudo systemctl unmask t.timer

sudo systemctl enable t.timer   
sudo systemctl start t.timer

=> ok

disable_feature:

sudo systemctl stop t.timer
sudo systemctl disable t.timer
sudo systemctl mask t.timer

sudo systemctl stop t.service
sudo systemctl disable t.timer  ?? why do it again
sudo systemctl mask t.timer ??

With new change:
disable:

sudo systemctl stop t.timer
sudo systemctl disable t.timer
sudo systemctl mask t.timer

sudo systemctl stop t.service
sudo systemctl disable t.service
sudo systemctl mask t.service

dhcp has [service]

enable:

sudo systemctl unmask d.service	
sudo systemctl enable d.service
sudo systemctl start d.service

=>ok
disable:

sudo systemctl stop d.service
sudo systemctl disable d.service  
sudo systemctl mask d.service 

=>ok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.