【问题标题】:Where can I find the source code for "reboot" command? [closed]我在哪里可以找到“重启”命令的源代码? [关闭]
【发布时间】:2011-01-06 07:08:42
【问题描述】:

从哪里获取 Linux 中reboot 命令的源代码?

【问题讨论】:

    标签: linux command reboot


    【解决方案1】:

    util-linux 中查看shutdown.c

    【讨论】:

    • 至少在 Scientific Linux 上,这个是 /sbin/shutdown cmd 的来源,而不是 /sbin/reboot。使用 rpm -qf 的另一个答案对我来说更好。
    【解决方案2】:

    在 RHEL / CentOS 上,至少它在 SysVinit 包中。您可以通过

    which reboot
    

    找到可执行文件 - 我在 /sbin/reboot - 然后

    rpm -qf /sbin/reboot
    

    找出它所在的软件包。然后您应该能够从任何 CentOS 镜像下载 SRPM,例如http://www.mirrorservice.org/sites/mirror.centos.org/5.5/os/SRPMS/

    【讨论】:

    • 沿着这些思路,dpkg -S /sbin/reboot 在基于 dpkg 的系统上查询所有者包,在 Ubuntu 上恰好是 upstart,在 Debian 上恰好是 sysvinitapt-get source 将获取源代码。太糟糕了,Linux 上没有任何单一的 init 系统;每个发行版都有自己的副本。 (即使是名为 sysvinit 的多个系统也不一样。)
    猜你喜欢
    • 1970-01-01
    • 2012-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-23
    相关资源
    最近更新 更多