修改ubuntu的启动级别 runlevel

-----------------------------------------------------------------------------------------------------

37down voteaccepted

Ubuntu 16.04 uses systemd instead of init and hence the concept of runlevels is replaced by the term targets. So there is indeed a mapping between init-based runlevels and systemd-based targets:

   Mapping between runlevels and systemd targets
┌─────────┬───────────────────┐
│Runlevel │ Target │
├─────────┼───────────────────┤
│0 │ poweroff.target │
├─────────┼───────────────────┤
│1 │ rescue.target │
├─────────┼───────────────────┤
│2, 3, 4 │ multi-user.target │
├─────────┼───────────────────┤
│5 │ graphical.target │
├─────────┼───────────────────┤
│6 │ reboot.target │
└─────────┴───────────────────┘

Now, to just change the "runlevels" in 16.04, you can use for eg:

sudo systemctl isolate multi-user.target

To make this the default "runlevel", you can use:

sudo systemctl enable multi-user.target
sudo systemctl set-default multi-user.target

From man systemctl

   isolate NAME
Start the unit specified on the command line and its dependencies and stop all others. If
a unit name with no extension is given, an extension of ".target" will be assumed. This is similar to changing the runlevel in a traditional init system. The isolate command
will immediately stop processes that are not enabled in the new unit, possibly including
the graphical environment or terminal you are currently using

Also have a look at man systemd.special to know more about the targets in systemd.

ubuntu 的runlevel设定的更多相关文章

  1. ubuntu 13.04 设定静态IP

    切换到root用户,然后进入/etc/network目录.备份interfaces文件(备份文件是一个好习惯) 下面编辑interfaces文件,添加如下语句: # Assgin static IP ...

  2. Ubuntu下pycharm设定任务栏图标后打开出现问号图标

    事情是这样的: ubuntu16.04,安装好pycharm后,bin下只有一个sh执行文件,想要弄成任务栏图标,所以在/usr/share/applications下新建文件pycharm.desk ...

  3. Ubuntu基础设定:openssh-server安装和使用

    记录一下Ubuntu17.10的openssh-server的安装和使用.安装之后就可以使用ssh登陆Ubuntu了,所以是Ubuntu的基础设定之一. 事前准备 Ubuntu版本:17.10 dev ...

  4. Ubuntu 开机自启动工具 update-rd.d 使用详解

    常用命令: $ sudo update-rc.d nginx defaults      #增加服务 $ sudo update-rc.d -f nginx remove    #移除服务 Linux ...

  5. ubuntu执行级别,设置单用户模式

    redhat的runlevel级别定义例如以下:   0:关机.不能将系统缺省执行级别设置为0,否则无法启动. 1:单用户模式.仅仅同意root用户对系统进行维护. 2:多用户模式.但不能使用NFS( ...

  6. 简单解决Ubuntu修改locale的问题

      本文针对的问题是“Ubuntu 安装中文语言包”“Ubuntu Server中文问题”,“Ubuntu更改语言环境”,“Ubuntu locale的设定”,“cannot change local ...

  7. ubuntu启动脚本一览分析

    #rc--run command的意思[rc解释]harvey@ubuntu:/etc$ cat ./init/rc-sysinit.conf # rc-sysinit - System V init ...

  8. linux学习笔记1-ubuntu的安装与基本设置

    ubuntu的安装 (1) 要装ubuntu首先当然得捣鼓一台机器,当然你用虚拟机也是可以的.本人的这台DELL品牌机是从某师兄脚底下挖出来的,大概很多年没人用了,内存1.25G|||- -,但是硬盘 ...

  9. Linux课程实践一:Linux基础实践(基础操作)

    一.软件源维护 1. 基本操作 (1)查看源列表 sudo vim /etc/apt/sources.list deb:二进制软件安装包 deb-src:源码包 (2)备份软件源列表 sudo cp ...

随机推荐

  1. 确实,k8s的时代,ingress负载用traefik比nginx方便啊

    参考文档: https://mritd.me/2016/12/06/try-traefik-on-kubernetes/#13ingress 由于微服务架构以及 Docker 技术和 kubernet ...

  2. CentOS上使用yum安装Apache

    关键词 CentOS上使用yum安装Apache 摘要 Apache在Linux系统中,其实叫“httpd”,它“无耻的”占据了官方名义!CentOS可以使用yum命令,非常简单和容易的安装Apach ...

  3. 【剑指offer】面试题 65. 不用加减乘除做加法

    面试题 65. 不用加减乘除做加法 题目描述 题目:写一个函数,求两个整数之和,要求在函数体内不得使用+.-.*./四则运算符号. Java 实现 public class Solution {    ...

  4. npoi的用法,动态的判断单元格的大小,设置列的宽度

    public MemoryStream GridToExcelByNPOI(DataTable dt, string strExcelFileName) { HSSFWorkbook wk = new ...

  5. HDU 4607.Park Visit-树的直径(BFS版)+结论公式(乱推公式)-备忘(加油!)

    Park Visit Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  6. poj 2262 筛法求素数(巧妙利用数组下标!)

    Goldbach's Conjecture Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 41582   Accepted: ...

  7. 原型开发工具 mockplus

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha 原型开发工具  mockplus 微信(演示) - Mockup Plus Web Ap ...

  8. java面试笔试总结(一)--亲生经历的面试题

    说明:本文只是自己的一些心得体会,答案也是自己写的,正确与否,还需考证 java笔试题    1java笔试题1 启动3个线程打印递增的数字, 线程1先打印1,2,3,4,5, 然后是线程2打印6,7 ...

  9. 8VC Venture Cup 2016 - Elimination Round G. Raffles 线段树

    G. Raffles 题目连接: http://www.codeforces.com/contest/626/problem/G Description Johnny is at a carnival ...

  10. 模式匹配之Kmp算法

    Kmp: 算法定义借鉴wikipedia: http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm#KMP_ ...