查看: 1494|回复: 0

[教程] 【一网打尽】Raspberry Pi Course Week 5 – Day 4 (Services)

[复制链接]
  • TA的每日心情
    开心
    2016-8-4 10:56
  • 签到天数: 242 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2015-3-28 13:03:12 | 显示全部楼层 |阅读模式
    分享到:

    A service is one or more applications that run in the background and do not require the console to run.  These services perform background task such as cleaning up temporary files, initialising the system, waiting for internet connection or running databases.  Some services will listen for connection from clients such as the Apache web server which will send out a web page when it receives a request connection.

    When a the Raspberry Pi boots up, the operating system starts these services and does this by the use of a program called init.  The init program uses a number of scripts to start and stop processes.

    Each distribution has run levels and each run level contains a number of services each designated to perform certain tasks.  For example you only require a basic installation without a desktop then there is no reason to load the run level with a desktop.  A run level of 0 is used to halt the system and it is this run level that is called into action when you shut down the system.  Run level 1 is used in single user mode only and a run level of 6 is used for rebooting.

    [Not all run systems are the same for each distribution so be sure to read the documentation]

    Services will sometimes need to be started, restarted,  etc.  Most services will allow you to interact with it from a console by calling upon scripts to do the work.  Links to these scripts can be found in the /etc/init.d directory and the syntax looks like this.

    /etc/init.d/the-command OPTION.

    Commands that can be used are start, stop, reload, restart and force-reload.

    [A service is commonly known as a daemon]

    Anacron is a service that runs in the background and executes commands throughout the  day, week, month or year depending on how it has been configured.  Stop this service by entering the following.

    $ sudo /etc/init.d/anacron stop

    Stopping anac(h)ronistic cron: anacron.

    Now start anacron again by entering.

    $ sudo /etc/init.d/anacron start

    Starting anac(h)ronistic cron: anacron.

    Anacron should now continue as a daemon in the background.


    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-6-3 12:29 , Processed in 0.106155 second(s), 15 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.