你若安好
便是晴天

Ubuntu18设置rc.local开机自启动

/etc/systemd/system/rc-local.service文件中追加以下内容

[Install]
WantedBy=multi-user.target

创建文件sudo touch /etc/rc.local,然后将以下内容复制到文件中

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "看到这行字,说明添加自启动脚本成功。" > /usr/local/test.log
exit 0

给rc.local加上权限

sudo chmod +x /etc/rc.local

启用服务

sudo systemctl enable rc.local

启动服务并检查状态

sudo systemctl start rc.local.service
sudo systemctl status rc.local.service

重启并检查test.log文件中的内容,确认脚本是否启动成功

cat /usr/local/test.log
原创作品未经允许不得转载:WTF博客 » Ubuntu18设置rc.local开机自启动

评论 15

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    Please visit the websites we follow, which includes this a single, because it represents our picks in the web. Hildy Derron Holub

    filmi full izle5个月前 (01-13)回复
  2. #2

    Menjalankan permainan poker ini pun juga cukup mudah. Rori Pinchas Dora

    online5个月前 (01-30)回复
  3. #3

    Super, bardzo mi się podoba ten artykuł.

    20215个月前 (01-31)回复
  4. #4

    I may now not do your analysis learn evaluations and testimonials are clear and goal to. Janot Davon Sylvan

    tek part5个月前 (02-01)回复
  5. #5

    Suzo, daj da se malo razjurimo oko tog video nadzora, mi bi kao klub mogli nesto da pomognemo. I plus da se okace te sijalice proklete tamo, da dvoriste bude osvetljeno. Mozda bih mogao nesto i u policiji da probam, i nama kao klubu odgovara da se tu vrzmaju policajci i policajke malo cesce. Mogli bi da nastupimo zajedno, skola, roditelji i klub. Ne mogli, nego bi trebali. Imas moj mail, javi se, pa da se organizujemo. Pozdrav! Ariana Vaclav Natasha

    direk5个月前 (02-01)回复
  6. #6

    Get best spy app via 15 percent OFF Discount for mSpy -15%. Tommie Paige Harle

    online5个月前 (02-01)回复
  7. #7

    I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. {comment test} Ailyn Joaquin Dorree

    movies5个月前 (02-02)回复
  8. #8

    Hola, gracias por contactarnos, un asesor experto contactara contigo Trescha Davey Garfinkel

    altyazili5个月前 (02-08)回复
  9. #9

    Constant dropping wears away a stone.

  10. #10

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://medium.com/@christensonxcovp78/butterfly-beach-ch-02-c57fa7734a50
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe2个月前 (04-16)回复
  11. #11

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://notepin.co/shared/dfhncop
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe2个月前 (04-22)回复
  12. #12

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://rentry.co/5gedy
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe2个月前 (05-01)回复
  13. #13

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://txt.fyi/-/20363/b1730f2f/
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe2个月前 (05-06)回复
  14. #14

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://telegra.ph/Enfolded-in-Sexuality-12-30 https://txt.fyi/-/20356/07d7b4ed/
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe1个月前 (05-13)回复
  15. #15

    The road seemed to stretch on endlessly before us, but Alexis assured me that our journey was near an end. We’d turn before long into thick woods and travel through narrow, winding roads until we reached her family’s cabin. I had no choice but to trust her as GPS had given out nearly 20 minutes ago.

    “There’s good wifi and okay reception at the cabin,” she’d told me, “but you can’t get there unless you know the way.”
    https://telegra.ph/Blind-Ice-10-14 https://notepin.co/shared/qlbknvm
    So here I was, driving alone in the middle of god knows where with a girl who was my student just a couple of weeks ago. Her and her four best friends had been together from first grade all the way through high school and now they had graduated with very different futures ahead of them. They had decided to kick off “the best summer ever” with a week long stay at Alexis’s family cabin. Alexis and I were heading up before everyone else, the four other girls and four guys.

    jimdofreeHoibe1个月前 (05-17)回复