如何在Snappy Ubuntu Core中设置autopilot

在Snappy Ubuntu Core中,autoupilot是它的一个特性.只要autopilot功能是开的情况下,并且我们的Snappy设备是在联网的情况下,它就可以自动联网并进行更新我们的Snappy Ubuntu Core.这个autopilot的开关在默认的情况下是开的.我们可以通过snappy config来设置它.


我们可以通过如下的命令来查看它目前的设置:

方法1

(amd64)ubuntu@localhost:~$ snappy config ubuntu-core | grep autopilot
    autopilot: true

我们可以看到它目前的开关是开的,意味着我们的Snappy系统在联网的情况下会自动更新我们的系统.

(amd64)ubuntu@localhost:~$ sudo systemctl stop snappy-autopilot.timer
(amd64)ubuntu@localhost:~$ sudo systemctl disable snappy-autopilot.timer
Removed symlink /etc/systemd/system/multi-user.target.wants/snappy-autopilot.timer.
(amd64)ubuntu@localhost:~$ snappy config ubuntu-core | grep autoupdate
(amd64)ubuntu@localhost:~$ snappy config ubuntu-core | grep autopilot
    autopilot: false

如果我们只是想暂时关掉它,我们可以使用stop来代替上面的disable.

我们可以通过如下的方式来重新打开这个开关:

(amd64)ubuntu@localhost:~$ sudo systemctl enable snappy-autopilot.timer
Created symlink from /etc/systemd/system/multi-user.target.wants/snappy-autopilot.timer to /lib/systemd/system/snappy-autopilot.timer.
(amd64)ubuntu@localhost:~$ sudo systemctl start snappy-autopilot.timer
(amd64)ubuntu@localhost:~$ snappy config ubuntu-core | grep autopilot
    autopilot: true

更多信息请参阅文章"Autopilot mode".

方法2

另外一种方法是使用如下的办法:

$ snappy config ubuntu-core > my.yaml

然后,我们们修改"autopilot"项为我们想要的值,然后在打入如下的命令:

$ sudo snappy config ubuntu-core my.yaml

方法3

$  echo 'config: {ubuntu-core: {autopilot: off}}' | sudo snappy config ubuntu-core -

上述命令将关掉autopilot

$  echo 'config: {ubuntu-core: {autopilot: on}}' | sudo snappy config ubuntu-core -

上述命令将打开autopilot开关

我们可以通过下面的方法来检查当前的状态:

$ snappy config ubuntu-core | grep autopilot






你可能感兴趣的:(Snappy,(old,15.04))